@autobe/ui 0.29.2 → 0.30.0-dev.20260315
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/LICENSE +661 -661
- package/README.md +261 -0
- package/lib/components/AutoBeChatMain.js +5 -5
- package/lib/components/AutoBeChatMain.js.map +1 -1
- package/lib/components/AutoBeConfigModal.js +9 -9
- package/lib/components/AutoBeStatusModal.js +4 -4
- package/lib/components/AutoBeStatusModal.js.map +1 -1
- package/lib/components/AutoBeUserMessageMovie.d.ts +2 -2
- package/lib/components/common/ChatBubble.d.ts +2 -2
- package/lib/components/common/openai/OpenAIContent.d.ts +2 -2
- package/lib/components/common/openai/OpenAIContent.js.map +1 -1
- package/lib/components/common/openai/OpenAIUserAudioContent.js +1 -1
- package/lib/components/common/openai/OpenAIUserAudioContent.js.map +1 -1
- package/lib/components/common/openai/OpenAIUserFileContent.js +1 -1
- package/lib/components/common/openai/OpenAIUserFileContent.js.map +1 -1
- package/lib/components/common/openai/OpenAIUserImageContent.d.ts +2 -2
- package/lib/components/events/AutoBeCompleteEventMovie.d.ts +2 -2
- package/lib/components/events/AutoBeCompleteEventMovie.js +5 -5
- package/lib/components/events/AutoBeCompleteEventMovie.js.map +1 -1
- package/lib/components/events/AutoBeCorrectEventMovie.d.ts +2 -2
- package/lib/components/events/AutoBeCorrectEventMovie.js +4 -4
- package/lib/components/events/AutoBeCorrectEventMovie.js.map +1 -1
- package/lib/components/events/AutoBeEventMovie.js +38 -17
- package/lib/components/events/AutoBeEventMovie.js.map +1 -1
- package/lib/components/events/AutoBeProgressEventMovie.js +73 -13
- package/lib/components/events/AutoBeProgressEventMovie.js.map +1 -1
- package/lib/components/events/AutoBeScenarioEventMovie.d.ts +2 -2
- package/lib/components/events/AutoBeScenarioEventMovie.js +18 -5
- package/lib/components/events/AutoBeScenarioEventMovie.js.map +1 -1
- package/lib/components/events/AutoBeStartEventMovie.d.ts +2 -2
- package/lib/components/events/AutoBeStartEventMovie.js +2 -2
- package/lib/components/events/AutoBeStartEventMovie.js.map +1 -1
- package/lib/components/events/AutoBeValidateEventMovie.d.ts +2 -2
- package/lib/components/events/AutoBeValidateEventMovie.js +3 -11
- package/lib/components/events/AutoBeValidateEventMovie.js.map +1 -1
- package/lib/components/events/groups/CorrectEventGroup.d.ts +2 -2
- package/lib/components/events/groups/CorrectEventGroup.js +1 -1
- package/lib/components/events/groups/CorrectEventGroup.js.map +1 -1
- package/lib/components/events/groups/ValidateEventGroup.d.ts +2 -2
- package/lib/components/events/groups/ValidateEventGroup.js +1 -2
- package/lib/components/events/groups/ValidateEventGroup.js.map +1 -1
- package/lib/components/events/utils/eventGrouper.js +1 -2
- package/lib/components/events/utils/eventGrouper.js.map +1 -1
- package/lib/components/upload/AutoBeChatUploadBox.d.ts +3 -4
- package/lib/components/upload/AutoBeChatUploadBox.js +2 -1
- package/lib/components/upload/AutoBeChatUploadBox.js.map +1 -1
- package/lib/components/upload/AutoBeChatUploadSendButton.js +1 -1
- package/lib/components/upload/AutoBeChatUploadSendButton.js.map +1 -1
- package/lib/context/AutoBeAgentContext.d.ts +1 -3
- package/lib/context/AutoBeAgentContext.js +0 -4
- package/lib/context/AutoBeAgentContext.js.map +1 -1
- package/lib/hooks/useSessionStorage.d.ts +4 -0
- package/lib/hooks/useSessionStorage.js +16 -0
- package/lib/hooks/useSessionStorage.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/strategy/AutoBeAgentSessionStorageStrategy.d.ts +10 -0
- package/lib/strategy/AutoBeAgentSessionStorageStrategy.js +117 -0
- package/lib/strategy/AutoBeAgentSessionStorageStrategy.js.map +1 -0
- package/lib/structure/AutoBeListener.js +91 -23
- package/lib/structure/AutoBeListener.js.map +1 -1
- package/lib/structure/AutoBeListenerState.d.ts +3 -3
- package/lib/structure/AutoBeListenerState.js +4 -4
- package/lib/structure/AutoBeListenerState.js.map +1 -1
- package/lib/structure/IAutoBeAgentSessionStorageStrategy.js +1 -1
- package/lib/structure/IAutoBeAgentSessionStorageStrategy.js.map +1 -1
- package/lib/utils/AutoBeFileUploader.d.ts +2 -2
- package/lib/utils/AutoBeFileUploader.js.map +1 -1
- package/package.json +3 -4
- package/src/components/AutoBeAssistantMessageMovie.tsx +22 -22
- package/src/components/AutoBeChatMain.tsx +376 -376
- package/src/components/AutoBeChatSidebar.tsx +414 -414
- package/src/components/AutoBeConfigButton.tsx +83 -83
- package/src/components/AutoBeConfigModal.tsx +443 -443
- package/src/components/AutoBeStatusButton.tsx +75 -75
- package/src/components/AutoBeStatusModal.tsx +486 -484
- package/src/components/AutoBeUserMessageMovie.tsx +27 -27
- package/src/components/common/ActionButton.tsx +205 -205
- package/src/components/common/ActionButtonGroup.tsx +80 -80
- package/src/components/common/AutoBeConfigInput.tsx +185 -185
- package/src/components/common/ChatBubble.tsx +119 -119
- package/src/components/common/Collapsible.tsx +95 -95
- package/src/components/common/CompactSessionIndicator.tsx +73 -73
- package/src/components/common/CompactSessionList.tsx +82 -82
- package/src/components/common/index.ts +8 -8
- package/src/components/common/openai/OpenAIContent.tsx +53 -53
- package/src/components/common/openai/OpenAIUserAudioContent.tsx +70 -70
- package/src/components/common/openai/OpenAIUserFileContent.tsx +76 -76
- package/src/components/common/openai/OpenAIUserImageContent.tsx +34 -34
- package/src/components/common/openai/OpenAIUserTextContent.tsx +15 -15
- package/src/components/common/openai/index.ts +5 -5
- package/src/components/events/AutoBeCompleteEventMovie.tsx +402 -402
- package/src/components/events/AutoBeCorrectEventMovie.tsx +354 -368
- package/src/components/events/AutoBeEventGroupMovie.tsx +18 -18
- package/src/components/events/AutoBeEventMovie.tsx +158 -139
- package/src/components/events/AutoBeProgressEventMovie.tsx +217 -157
- package/src/components/events/AutoBeScenarioEventMovie.tsx +135 -95
- package/src/components/events/AutoBeStartEventMovie.tsx +82 -82
- package/src/components/events/AutoBeValidateEventMovie.tsx +249 -286
- package/src/components/events/README.md +300 -300
- package/src/components/events/common/CollapsibleEventGroup.tsx +211 -211
- package/src/components/events/common/EventCard.tsx +61 -61
- package/src/components/events/common/EventContent.tsx +31 -31
- package/src/components/events/common/EventHeader.tsx +85 -85
- package/src/components/events/common/EventIcon.tsx +82 -82
- package/src/components/events/common/ProgressBar.tsx +64 -64
- package/src/components/events/common/index.ts +13 -13
- package/src/components/events/groups/CorrectEventGroup.tsx +183 -183
- package/src/components/events/groups/ValidateEventGroup.tsx +143 -146
- package/src/components/events/groups/index.ts +8 -8
- package/src/components/events/index.ts +16 -16
- package/src/components/events/utils/eventGrouper.tsx +116 -117
- package/src/components/events/utils/index.ts +1 -1
- package/src/components/index.ts +13 -13
- package/src/components/upload/AutoBeChatUploadBox.tsx +425 -424
- package/src/components/upload/AutoBeChatUploadSendButton.tsx +66 -66
- package/src/components/upload/AutoBeFileUploadBox.tsx +123 -123
- package/src/components/upload/AutoBeUploadConfig.ts +5 -5
- package/src/components/upload/AutoBeVoiceRecoderButton.tsx +100 -100
- package/src/components/upload/index.ts +5 -5
- package/src/constant/color.ts +28 -28
- package/src/context/AutoBeAgentContext.tsx +245 -258
- package/src/context/AutoBeAgentSessionList.tsx +58 -58
- package/src/context/SearchParamsContext.tsx +49 -49
- package/src/hooks/index.ts +3 -3
- package/src/hooks/useEscapeKey.ts +24 -24
- package/src/hooks/useIsomorphicLayoutEffect.ts +8 -8
- package/src/hooks/useMediaQuery.ts +73 -73
- package/src/hooks/useSessionStorage.ts +10 -0
- package/src/icons/Receipt.tsx +74 -74
- package/src/index.ts +9 -8
- package/src/strategy/AutoBeAgentSessionStorageStrategy.ts +127 -0
- package/src/structure/AutoBeListener.ts +373 -304
- package/src/structure/AutoBeListenerState.ts +53 -53
- package/src/structure/IAutoBeAgentSessionStorageStrategy.ts +87 -87
- package/src/structure/IAutoBeEventGroup.ts +6 -6
- package/src/structure/index.ts +4 -4
- package/src/types/config.ts +44 -44
- package/src/types/index.ts +1 -1
- package/src/utils/AutoBeFileUploader.ts +279 -279
- package/src/utils/AutoBeVoiceRecorder.ts +95 -95
- package/src/utils/__tests__/crypto.test.ts +286 -286
- package/src/utils/__tests__/storage.test.ts +229 -229
- package/src/utils/crypto.ts +95 -95
- package/src/utils/index.ts +6 -6
- package/src/utils/number.ts +17 -17
- package/src/utils/storage.ts +96 -96
- package/src/utils/time.ts +14 -14
- package/tsconfig.json +9 -9
- package/vitest.config.ts +15 -15
|
@@ -1,183 +1,183 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
AutoBeRealizeAuthorizationCorrectEvent,
|
|
4
|
-
AutoBeRealizeCorrectEvent,
|
|
5
|
-
AutoBeTestCorrectEvent,
|
|
6
|
-
} from "@autobe/interface";
|
|
7
|
-
|
|
8
|
-
import { AutoBeCorrectEventMovie } from "../AutoBeCorrectEventMovie";
|
|
9
|
-
import { CollapsibleEventGroup } from "../common/CollapsibleEventGroup";
|
|
10
|
-
|
|
11
|
-
type CorrectEvent =
|
|
12
|
-
|
|
|
13
|
-
| AutoBeTestCorrectEvent
|
|
14
|
-
| AutoBeRealizeCorrectEvent
|
|
15
|
-
| AutoBeRealizeAuthorizationCorrectEvent;
|
|
16
|
-
|
|
17
|
-
export interface ICorrectEventGroupProps {
|
|
18
|
-
events: CorrectEvent[];
|
|
19
|
-
defaultCollapsed?: boolean;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Specialized group component for correction events Shows correction summary
|
|
24
|
-
* and statistics
|
|
25
|
-
*/
|
|
26
|
-
export const CorrectEventGroup = (props: ICorrectEventGroupProps) => {
|
|
27
|
-
const { events, defaultCollapsed = true } = props;
|
|
28
|
-
|
|
29
|
-
if (events.length === 0) {
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// Calculate correction statistics
|
|
34
|
-
const eventTypes = Array.from(new Set(events.map((e) => e.type)));
|
|
35
|
-
const eventTypeCounts = eventTypes.reduce(
|
|
36
|
-
(acc, type) => {
|
|
37
|
-
acc[type] = events.filter((e) => e.type === type).length;
|
|
38
|
-
return acc;
|
|
39
|
-
},
|
|
40
|
-
{} as Record<string, number>,
|
|
41
|
-
);
|
|
42
|
-
|
|
43
|
-
// Get latest step numbers for each event type
|
|
44
|
-
const latestSteps = eventTypes.reduce(
|
|
45
|
-
(acc, type) => {
|
|
46
|
-
const eventsOfType = events.filter((e) => e.type === type);
|
|
47
|
-
acc[type] = Math.max(...eventsOfType.map((e) => e.step));
|
|
48
|
-
return acc;
|
|
49
|
-
},
|
|
50
|
-
{} as Record<string, number>,
|
|
51
|
-
);
|
|
52
|
-
|
|
53
|
-
const renderSummary = (events: CorrectEvent[]) => (
|
|
54
|
-
<>
|
|
55
|
-
Correction events showing AI self-improvement feedback loop
|
|
56
|
-
<br />
|
|
57
|
-
<br />
|
|
58
|
-
<strong>Success Rate:</strong> 100% (All corrections applied successfully)
|
|
59
|
-
<br />
|
|
60
|
-
<strong>Total Corrections:</strong> {events.length} events
|
|
61
|
-
<br />
|
|
62
|
-
<strong>Event Types:</strong> {eventTypes.join(", ")}
|
|
63
|
-
<br />
|
|
64
|
-
<br />
|
|
65
|
-
<div
|
|
66
|
-
style={{
|
|
67
|
-
display: "flex",
|
|
68
|
-
flexDirection: "column",
|
|
69
|
-
gap: "0.5rem",
|
|
70
|
-
}}
|
|
71
|
-
>
|
|
72
|
-
{eventTypes.map((type) => {
|
|
73
|
-
const typeDisplayNames = {
|
|
74
|
-
|
|
75
|
-
testCorrect: "🧪 Test Suite",
|
|
76
|
-
realizeCorrect: "⚙️ Implementation",
|
|
77
|
-
realizeAuthorizationCorrect: "🔐 Authorization",
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
return (
|
|
81
|
-
<div
|
|
82
|
-
key={type}
|
|
83
|
-
style={{
|
|
84
|
-
display: "flex",
|
|
85
|
-
justifyContent: "space-between",
|
|
86
|
-
alignItems: "center",
|
|
87
|
-
padding: "0.5rem",
|
|
88
|
-
backgroundColor: "#f0fdf4",
|
|
89
|
-
borderRadius: "0.25rem",
|
|
90
|
-
border: "1px solid #bbf7d0",
|
|
91
|
-
}}
|
|
92
|
-
>
|
|
93
|
-
<span style={{ fontSize: "0.75rem", fontWeight: "500" }}>
|
|
94
|
-
{typeDisplayNames[type as keyof typeof typeDisplayNames] ||
|
|
95
|
-
type}
|
|
96
|
-
</span>
|
|
97
|
-
<div
|
|
98
|
-
style={{ display: "flex", gap: "1rem", alignItems: "center" }}
|
|
99
|
-
>
|
|
100
|
-
<span style={{ fontSize: "0.75rem", color: "#16a34a" }}>
|
|
101
|
-
{eventTypeCounts[type]} corrections
|
|
102
|
-
</span>
|
|
103
|
-
<span
|
|
104
|
-
style={{
|
|
105
|
-
fontSize: "0.625rem",
|
|
106
|
-
color: "#64748b",
|
|
107
|
-
fontFamily: "monospace",
|
|
108
|
-
backgroundColor: "#e2e8f0",
|
|
109
|
-
padding: "0.125rem 0.375rem",
|
|
110
|
-
borderRadius: "0.25rem",
|
|
111
|
-
}}
|
|
112
|
-
>
|
|
113
|
-
Step {latestSteps[type]}
|
|
114
|
-
</span>
|
|
115
|
-
</div>
|
|
116
|
-
</div>
|
|
117
|
-
);
|
|
118
|
-
})}
|
|
119
|
-
</div>
|
|
120
|
-
<br />
|
|
121
|
-
<div
|
|
122
|
-
style={{
|
|
123
|
-
display: "flex",
|
|
124
|
-
gap: "0.5rem",
|
|
125
|
-
alignItems: "center",
|
|
126
|
-
}}
|
|
127
|
-
>
|
|
128
|
-
<div
|
|
129
|
-
style={{
|
|
130
|
-
display: "flex",
|
|
131
|
-
alignItems: "center",
|
|
132
|
-
gap: "0.25rem",
|
|
133
|
-
}}
|
|
134
|
-
>
|
|
135
|
-
<div
|
|
136
|
-
style={{
|
|
137
|
-
width: "12px",
|
|
138
|
-
height: "12px",
|
|
139
|
-
backgroundColor: "#16a34a",
|
|
140
|
-
borderRadius: "2px",
|
|
141
|
-
}}
|
|
142
|
-
/>
|
|
143
|
-
<span style={{ fontSize: "0.75rem" }}>
|
|
144
|
-
Corrected: {events.length}
|
|
145
|
-
</span>
|
|
146
|
-
</div>
|
|
147
|
-
<div
|
|
148
|
-
style={{
|
|
149
|
-
display: "flex",
|
|
150
|
-
alignItems: "center",
|
|
151
|
-
gap: "0.25rem",
|
|
152
|
-
}}
|
|
153
|
-
>
|
|
154
|
-
<div
|
|
155
|
-
style={{
|
|
156
|
-
width: "12px",
|
|
157
|
-
height: "12px",
|
|
158
|
-
backgroundColor: "#10b981",
|
|
159
|
-
borderRadius: "2px",
|
|
160
|
-
}}
|
|
161
|
-
/>
|
|
162
|
-
<span style={{ fontSize: "0.75rem" }}>Self-Improvement Active</span>
|
|
163
|
-
</div>
|
|
164
|
-
</div>
|
|
165
|
-
</>
|
|
166
|
-
);
|
|
167
|
-
|
|
168
|
-
return (
|
|
169
|
-
<CollapsibleEventGroup
|
|
170
|
-
events={events}
|
|
171
|
-
title="Correction Events"
|
|
172
|
-
iconType="success"
|
|
173
|
-
variant="success"
|
|
174
|
-
getTimestamp={(event) => event.created_at}
|
|
175
|
-
renderEvent={(event) => <AutoBeCorrectEventMovie event={event} />}
|
|
176
|
-
renderSummary={renderSummary}
|
|
177
|
-
defaultCollapsed={defaultCollapsed}
|
|
178
|
-
description="AI self-correction and improvement events"
|
|
179
|
-
/>
|
|
180
|
-
);
|
|
181
|
-
};
|
|
182
|
-
|
|
183
|
-
export default CorrectEventGroup;
|
|
1
|
+
import {
|
|
2
|
+
AutoBeDatabaseCorrectEvent,
|
|
3
|
+
AutoBeRealizeAuthorizationCorrectEvent,
|
|
4
|
+
AutoBeRealizeCorrectEvent,
|
|
5
|
+
AutoBeTestCorrectEvent,
|
|
6
|
+
} from "@autobe/interface";
|
|
7
|
+
|
|
8
|
+
import { AutoBeCorrectEventMovie } from "../AutoBeCorrectEventMovie";
|
|
9
|
+
import { CollapsibleEventGroup } from "../common/CollapsibleEventGroup";
|
|
10
|
+
|
|
11
|
+
type CorrectEvent =
|
|
12
|
+
| AutoBeDatabaseCorrectEvent
|
|
13
|
+
| AutoBeTestCorrectEvent
|
|
14
|
+
| AutoBeRealizeCorrectEvent
|
|
15
|
+
| AutoBeRealizeAuthorizationCorrectEvent;
|
|
16
|
+
|
|
17
|
+
export interface ICorrectEventGroupProps {
|
|
18
|
+
events: CorrectEvent[];
|
|
19
|
+
defaultCollapsed?: boolean;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Specialized group component for correction events Shows correction summary
|
|
24
|
+
* and statistics
|
|
25
|
+
*/
|
|
26
|
+
export const CorrectEventGroup = (props: ICorrectEventGroupProps) => {
|
|
27
|
+
const { events, defaultCollapsed = true } = props;
|
|
28
|
+
|
|
29
|
+
if (events.length === 0) {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Calculate correction statistics
|
|
34
|
+
const eventTypes = Array.from(new Set(events.map((e) => e.type)));
|
|
35
|
+
const eventTypeCounts = eventTypes.reduce(
|
|
36
|
+
(acc, type) => {
|
|
37
|
+
acc[type] = events.filter((e) => e.type === type).length;
|
|
38
|
+
return acc;
|
|
39
|
+
},
|
|
40
|
+
{} as Record<string, number>,
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
// Get latest step numbers for each event type
|
|
44
|
+
const latestSteps = eventTypes.reduce(
|
|
45
|
+
(acc, type) => {
|
|
46
|
+
const eventsOfType = events.filter((e) => e.type === type);
|
|
47
|
+
acc[type] = Math.max(...eventsOfType.map((e) => e.step));
|
|
48
|
+
return acc;
|
|
49
|
+
},
|
|
50
|
+
{} as Record<string, number>,
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
const renderSummary = (events: CorrectEvent[]) => (
|
|
54
|
+
<>
|
|
55
|
+
Correction events showing AI self-improvement feedback loop
|
|
56
|
+
<br />
|
|
57
|
+
<br />
|
|
58
|
+
<strong>Success Rate:</strong> 100% (All corrections applied successfully)
|
|
59
|
+
<br />
|
|
60
|
+
<strong>Total Corrections:</strong> {events.length} events
|
|
61
|
+
<br />
|
|
62
|
+
<strong>Event Types:</strong> {eventTypes.join(", ")}
|
|
63
|
+
<br />
|
|
64
|
+
<br />
|
|
65
|
+
<div
|
|
66
|
+
style={{
|
|
67
|
+
display: "flex",
|
|
68
|
+
flexDirection: "column",
|
|
69
|
+
gap: "0.5rem",
|
|
70
|
+
}}
|
|
71
|
+
>
|
|
72
|
+
{eventTypes.map((type) => {
|
|
73
|
+
const typeDisplayNames = {
|
|
74
|
+
databaseCorrect: "🗄️ Database Schema",
|
|
75
|
+
testCorrect: "🧪 Test Suite",
|
|
76
|
+
realizeCorrect: "⚙️ Implementation",
|
|
77
|
+
realizeAuthorizationCorrect: "🔐 Authorization",
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
return (
|
|
81
|
+
<div
|
|
82
|
+
key={type}
|
|
83
|
+
style={{
|
|
84
|
+
display: "flex",
|
|
85
|
+
justifyContent: "space-between",
|
|
86
|
+
alignItems: "center",
|
|
87
|
+
padding: "0.5rem",
|
|
88
|
+
backgroundColor: "#f0fdf4",
|
|
89
|
+
borderRadius: "0.25rem",
|
|
90
|
+
border: "1px solid #bbf7d0",
|
|
91
|
+
}}
|
|
92
|
+
>
|
|
93
|
+
<span style={{ fontSize: "0.75rem", fontWeight: "500" }}>
|
|
94
|
+
{typeDisplayNames[type as keyof typeof typeDisplayNames] ||
|
|
95
|
+
type}
|
|
96
|
+
</span>
|
|
97
|
+
<div
|
|
98
|
+
style={{ display: "flex", gap: "1rem", alignItems: "center" }}
|
|
99
|
+
>
|
|
100
|
+
<span style={{ fontSize: "0.75rem", color: "#16a34a" }}>
|
|
101
|
+
{eventTypeCounts[type]} corrections
|
|
102
|
+
</span>
|
|
103
|
+
<span
|
|
104
|
+
style={{
|
|
105
|
+
fontSize: "0.625rem",
|
|
106
|
+
color: "#64748b",
|
|
107
|
+
fontFamily: "monospace",
|
|
108
|
+
backgroundColor: "#e2e8f0",
|
|
109
|
+
padding: "0.125rem 0.375rem",
|
|
110
|
+
borderRadius: "0.25rem",
|
|
111
|
+
}}
|
|
112
|
+
>
|
|
113
|
+
Step {latestSteps[type]}
|
|
114
|
+
</span>
|
|
115
|
+
</div>
|
|
116
|
+
</div>
|
|
117
|
+
);
|
|
118
|
+
})}
|
|
119
|
+
</div>
|
|
120
|
+
<br />
|
|
121
|
+
<div
|
|
122
|
+
style={{
|
|
123
|
+
display: "flex",
|
|
124
|
+
gap: "0.5rem",
|
|
125
|
+
alignItems: "center",
|
|
126
|
+
}}
|
|
127
|
+
>
|
|
128
|
+
<div
|
|
129
|
+
style={{
|
|
130
|
+
display: "flex",
|
|
131
|
+
alignItems: "center",
|
|
132
|
+
gap: "0.25rem",
|
|
133
|
+
}}
|
|
134
|
+
>
|
|
135
|
+
<div
|
|
136
|
+
style={{
|
|
137
|
+
width: "12px",
|
|
138
|
+
height: "12px",
|
|
139
|
+
backgroundColor: "#16a34a",
|
|
140
|
+
borderRadius: "2px",
|
|
141
|
+
}}
|
|
142
|
+
/>
|
|
143
|
+
<span style={{ fontSize: "0.75rem" }}>
|
|
144
|
+
Corrected: {events.length}
|
|
145
|
+
</span>
|
|
146
|
+
</div>
|
|
147
|
+
<div
|
|
148
|
+
style={{
|
|
149
|
+
display: "flex",
|
|
150
|
+
alignItems: "center",
|
|
151
|
+
gap: "0.25rem",
|
|
152
|
+
}}
|
|
153
|
+
>
|
|
154
|
+
<div
|
|
155
|
+
style={{
|
|
156
|
+
width: "12px",
|
|
157
|
+
height: "12px",
|
|
158
|
+
backgroundColor: "#10b981",
|
|
159
|
+
borderRadius: "2px",
|
|
160
|
+
}}
|
|
161
|
+
/>
|
|
162
|
+
<span style={{ fontSize: "0.75rem" }}>Self-Improvement Active</span>
|
|
163
|
+
</div>
|
|
164
|
+
</div>
|
|
165
|
+
</>
|
|
166
|
+
);
|
|
167
|
+
|
|
168
|
+
return (
|
|
169
|
+
<CollapsibleEventGroup
|
|
170
|
+
events={events}
|
|
171
|
+
title="Correction Events"
|
|
172
|
+
iconType="success"
|
|
173
|
+
variant="success"
|
|
174
|
+
getTimestamp={(event) => event.created_at}
|
|
175
|
+
renderEvent={(event) => <AutoBeCorrectEventMovie event={event} />}
|
|
176
|
+
renderSummary={renderSummary}
|
|
177
|
+
defaultCollapsed={defaultCollapsed}
|
|
178
|
+
description="AI self-correction and improvement events"
|
|
179
|
+
/>
|
|
180
|
+
);
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
export default CorrectEventGroup;
|
|
@@ -1,146 +1,143 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
|
15
|
-
|
|
|
16
|
-
|
|
|
17
|
-
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
case "
|
|
42
|
-
case "
|
|
43
|
-
return
|
|
44
|
-
case "
|
|
45
|
-
|
|
46
|
-
return
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
<
|
|
67
|
-
<
|
|
68
|
-
<
|
|
69
|
-
<
|
|
70
|
-
<br />
|
|
71
|
-
<
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
export default ValidateEventGroup;
|
|
1
|
+
import {
|
|
2
|
+
AutoBeDatabaseValidateEvent,
|
|
3
|
+
AutoBeInterfaceOperationReviewEvent,
|
|
4
|
+
AutoBeRealizeAuthorizationValidateEvent,
|
|
5
|
+
AutoBeRealizeValidateEvent,
|
|
6
|
+
AutoBeTestValidateEvent,
|
|
7
|
+
} from "@autobe/interface";
|
|
8
|
+
|
|
9
|
+
import { AutoBeValidateEventMovie } from "../AutoBeValidateEventMovie";
|
|
10
|
+
import { CollapsibleEventGroup } from "../common/CollapsibleEventGroup";
|
|
11
|
+
|
|
12
|
+
export type ValidateEvent =
|
|
13
|
+
| AutoBeDatabaseValidateEvent
|
|
14
|
+
| AutoBeInterfaceOperationReviewEvent
|
|
15
|
+
| AutoBeTestValidateEvent
|
|
16
|
+
| AutoBeRealizeValidateEvent
|
|
17
|
+
| AutoBeRealizeAuthorizationValidateEvent;
|
|
18
|
+
|
|
19
|
+
export interface IValidateEventGroupProps {
|
|
20
|
+
events: ValidateEvent[];
|
|
21
|
+
defaultCollapsed?: boolean;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Specialized group component for validation events Shows validation summary
|
|
26
|
+
* and error statistics
|
|
27
|
+
*/
|
|
28
|
+
export const ValidateEventGroup = (props: IValidateEventGroupProps) => {
|
|
29
|
+
const { events, defaultCollapsed = true } = props;
|
|
30
|
+
|
|
31
|
+
if (events.length === 0) {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Calculate validation statistics
|
|
36
|
+
const errorEvents = events.filter((event) => {
|
|
37
|
+
switch (event.type) {
|
|
38
|
+
case "databaseValidate":
|
|
39
|
+
case "realizeValidate":
|
|
40
|
+
return true;
|
|
41
|
+
case "testValidate":
|
|
42
|
+
case "realizeAuthorizationValidate":
|
|
43
|
+
return event.result.type !== "success";
|
|
44
|
+
case "interfaceOperationReview":
|
|
45
|
+
default:
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
}).length;
|
|
49
|
+
|
|
50
|
+
const successEvents = events.length - errorEvents;
|
|
51
|
+
const eventTypes = Array.from(new Set(events.map((e) => e.type)));
|
|
52
|
+
|
|
53
|
+
const renderSummary = (events: ValidateEvent[]) => (
|
|
54
|
+
<>
|
|
55
|
+
Validation and review events from various components
|
|
56
|
+
<br />
|
|
57
|
+
<br />
|
|
58
|
+
<strong>Success Rate:</strong>{" "}
|
|
59
|
+
{events.length > 0
|
|
60
|
+
? Math.round((successEvents / events.length) * 100)
|
|
61
|
+
: 0}
|
|
62
|
+
%
|
|
63
|
+
<br />
|
|
64
|
+
<strong>Successful:</strong> {successEvents} events
|
|
65
|
+
<br />
|
|
66
|
+
<strong>Failed/Issues:</strong> {errorEvents} events
|
|
67
|
+
<br />
|
|
68
|
+
<strong>Event Types:</strong> {eventTypes.join(", ")}
|
|
69
|
+
<br />
|
|
70
|
+
<br />
|
|
71
|
+
<div
|
|
72
|
+
style={{
|
|
73
|
+
display: "flex",
|
|
74
|
+
gap: "0.5rem",
|
|
75
|
+
alignItems: "center",
|
|
76
|
+
}}
|
|
77
|
+
>
|
|
78
|
+
<div
|
|
79
|
+
style={{
|
|
80
|
+
display: "flex",
|
|
81
|
+
alignItems: "center",
|
|
82
|
+
gap: "0.25rem",
|
|
83
|
+
}}
|
|
84
|
+
>
|
|
85
|
+
<div
|
|
86
|
+
style={{
|
|
87
|
+
width: "12px",
|
|
88
|
+
height: "12px",
|
|
89
|
+
backgroundColor: "#4caf50",
|
|
90
|
+
borderRadius: "2px",
|
|
91
|
+
}}
|
|
92
|
+
/>
|
|
93
|
+
<span style={{ fontSize: "0.75rem" }}>Success: {successEvents}</span>
|
|
94
|
+
</div>
|
|
95
|
+
<div
|
|
96
|
+
style={{
|
|
97
|
+
display: "flex",
|
|
98
|
+
alignItems: "center",
|
|
99
|
+
gap: "0.25rem",
|
|
100
|
+
}}
|
|
101
|
+
>
|
|
102
|
+
<div
|
|
103
|
+
style={{
|
|
104
|
+
width: "12px",
|
|
105
|
+
height: "12px",
|
|
106
|
+
backgroundColor: "#f59e0b",
|
|
107
|
+
borderRadius: "2px",
|
|
108
|
+
}}
|
|
109
|
+
/>
|
|
110
|
+
<span style={{ fontSize: "0.75rem" }}>Issues: {errorEvents}</span>
|
|
111
|
+
</div>
|
|
112
|
+
</div>
|
|
113
|
+
</>
|
|
114
|
+
);
|
|
115
|
+
|
|
116
|
+
const getGroupIconType = () => {
|
|
117
|
+
if (errorEvents === 0) return "success"; // All successful
|
|
118
|
+
if (successEvents === 0) return "warning"; // All failed
|
|
119
|
+
return "warning"; // Mixed results
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
const getGroupVariant = () => {
|
|
123
|
+
if (errorEvents === 0) return "success"; // All successful
|
|
124
|
+
if (successEvents === 0) return "warning"; // All failed
|
|
125
|
+
return "warning"; // Mixed results
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
return (
|
|
129
|
+
<CollapsibleEventGroup
|
|
130
|
+
events={events}
|
|
131
|
+
title="Validation Events"
|
|
132
|
+
iconType={getGroupIconType()}
|
|
133
|
+
variant={getGroupVariant()}
|
|
134
|
+
getTimestamp={(event) => event.created_at}
|
|
135
|
+
renderEvent={(event) => <AutoBeValidateEventMovie event={event} />}
|
|
136
|
+
renderSummary={renderSummary}
|
|
137
|
+
defaultCollapsed={defaultCollapsed}
|
|
138
|
+
description="Validation and review events"
|
|
139
|
+
/>
|
|
140
|
+
);
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
export default ValidateEventGroup;
|