@autobe/ui 0.30.2 → 0.30.4-dev.20260324

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 (69) hide show
  1. package/LICENSE +661 -661
  2. package/README.md +261 -0
  3. package/lib/components/AutoBeChatMain.d.ts +6 -0
  4. package/lib/components/AutoBeChatMain.js +46 -37
  5. package/lib/components/AutoBeChatMain.js.map +1 -1
  6. package/lib/components/AutoBeConfigModal.js +9 -9
  7. package/lib/components/events/AutoBeEventMovie.js +0 -4
  8. package/lib/components/events/AutoBeEventMovie.js.map +1 -1
  9. package/lib/components/events/AutoBeProgressEventMovie.js +0 -10
  10. package/lib/components/events/AutoBeProgressEventMovie.js.map +1 -1
  11. package/lib/components/upload/AutoBeChatUploadBox.d.ts +1 -0
  12. package/lib/components/upload/AutoBeChatUploadBox.js +11 -16
  13. package/lib/components/upload/AutoBeChatUploadBox.js.map +1 -1
  14. package/lib/context/AutoBeAgentContext.js +78 -30
  15. package/lib/context/AutoBeAgentContext.js.map +1 -1
  16. package/lib/context/SearchParamsContext.js +1 -1
  17. package/lib/context/SearchParamsContext.js.map +1 -1
  18. package/lib/structure/AutoBeListener.d.ts +1 -0
  19. package/lib/structure/AutoBeListener.js +9 -11
  20. package/lib/structure/AutoBeListener.js.map +1 -1
  21. package/package.json +2 -2
  22. package/src/components/AutoBeAssistantMessageMovie.tsx +22 -22
  23. package/src/components/AutoBeChatMain.tsx +394 -376
  24. package/src/components/AutoBeChatSidebar.tsx +414 -414
  25. package/src/components/AutoBeConfigButton.tsx +83 -83
  26. package/src/components/AutoBeConfigModal.tsx +443 -443
  27. package/src/components/AutoBeStatusButton.tsx +75 -75
  28. package/src/components/AutoBeStatusModal.tsx +486 -486
  29. package/src/components/AutoBeUserMessageMovie.tsx +27 -27
  30. package/src/components/common/ActionButton.tsx +205 -205
  31. package/src/components/common/ActionButtonGroup.tsx +80 -80
  32. package/src/components/common/AutoBeConfigInput.tsx +185 -185
  33. package/src/components/common/ChatBubble.tsx +119 -119
  34. package/src/components/common/Collapsible.tsx +95 -95
  35. package/src/components/common/CompactSessionIndicator.tsx +73 -73
  36. package/src/components/common/CompactSessionList.tsx +82 -82
  37. package/src/components/common/openai/OpenAIContent.tsx +53 -53
  38. package/src/components/common/openai/OpenAIUserAudioContent.tsx +70 -70
  39. package/src/components/common/openai/OpenAIUserFileContent.tsx +76 -76
  40. package/src/components/common/openai/OpenAIUserImageContent.tsx +34 -34
  41. package/src/components/common/openai/OpenAIUserTextContent.tsx +15 -15
  42. package/src/components/events/AutoBeCompleteEventMovie.tsx +402 -402
  43. package/src/components/events/AutoBeCorrectEventMovie.tsx +354 -354
  44. package/src/components/events/AutoBeEventGroupMovie.tsx +18 -18
  45. package/src/components/events/AutoBeEventMovie.tsx +154 -158
  46. package/src/components/events/AutoBeProgressEventMovie.tsx +207 -217
  47. package/src/components/events/AutoBeScenarioEventMovie.tsx +135 -135
  48. package/src/components/events/AutoBeStartEventMovie.tsx +82 -82
  49. package/src/components/events/AutoBeValidateEventMovie.tsx +249 -249
  50. package/src/components/events/README.md +300 -300
  51. package/src/components/events/common/CollapsibleEventGroup.tsx +211 -211
  52. package/src/components/events/common/EventCard.tsx +61 -61
  53. package/src/components/events/common/EventContent.tsx +31 -31
  54. package/src/components/events/common/EventHeader.tsx +85 -85
  55. package/src/components/events/common/EventIcon.tsx +82 -82
  56. package/src/components/events/common/ProgressBar.tsx +64 -64
  57. package/src/components/events/groups/CorrectEventGroup.tsx +183 -183
  58. package/src/components/events/groups/ValidateEventGroup.tsx +143 -143
  59. package/src/components/events/utils/eventGrouper.tsx +116 -116
  60. package/src/components/upload/AutoBeChatUploadBox.tsx +433 -425
  61. package/src/components/upload/AutoBeChatUploadSendButton.tsx +66 -66
  62. package/src/components/upload/AutoBeFileUploadBox.tsx +123 -123
  63. package/src/components/upload/AutoBeVoiceRecoderButton.tsx +100 -100
  64. package/src/context/AutoBeAgentContext.tsx +301 -245
  65. package/src/context/AutoBeAgentSessionList.tsx +58 -58
  66. package/src/context/SearchParamsContext.tsx +49 -49
  67. package/src/icons/Receipt.tsx +74 -74
  68. package/src/structure/AutoBeListener.ts +368 -373
  69. package/tsconfig.json +9 -9
@@ -1,354 +1,354 @@
1
- import {
2
- AutoBeDatabaseCorrectEvent,
3
- AutoBeRealizeAuthorizationCorrectEvent,
4
- AutoBeRealizeCorrectEvent,
5
- AutoBeTestCorrectEvent,
6
- } from "@autobe/interface";
7
- import React from "react";
8
-
9
- import { EventCard, EventContent, EventHeader } from "./common";
10
-
11
- /** Props interface for AutoBeCorrectEventMovie component */
12
- export interface IAutoBeCorrectEventMovieProps {
13
- /** Correct event to display */
14
- event:
15
- | AutoBeDatabaseCorrectEvent
16
- | AutoBeTestCorrectEvent
17
- | AutoBeRealizeCorrectEvent
18
- | AutoBeRealizeAuthorizationCorrectEvent;
19
- }
20
-
21
- /** Event type definition */
22
- type CorrectEventType =
23
- | "databaseCorrect"
24
- | "testCorrect"
25
- | "realizeCorrect"
26
- | "realizeAuthorizationCorrect";
27
-
28
- /** Get step configuration based on event type */
29
- function getStepConfig(eventType: CorrectEventType): {
30
- title: string;
31
- description: string;
32
- } {
33
- switch (eventType) {
34
- case "databaseCorrect":
35
- return {
36
- title: "Prisma Schema Corrected",
37
- description: "Database schema has been successfully corrected",
38
- };
39
- case "testCorrect":
40
- return {
41
- title: "Test Code Corrected",
42
- description: "Test implementation has been successfully corrected",
43
- };
44
- case "realizeCorrect":
45
- return {
46
- title: "Implementation Corrected",
47
- description: "API implementation has been successfully corrected",
48
- };
49
- case "realizeAuthorizationCorrect":
50
- return {
51
- title: "Authorization Corrected",
52
- description: "Authorization logic has been successfully corrected",
53
- };
54
- default:
55
- eventType satisfies never;
56
- throw new Error(`Unknown event type: ${eventType}`);
57
- }
58
- }
59
-
60
- /** Get additional details section based on event type */
61
- function getEventDetails(
62
- event: IAutoBeCorrectEventMovieProps["event"],
63
- ): React.ReactElement | null {
64
- const containerStyle: React.CSSProperties = {
65
- display: "flex",
66
- flexDirection: "column",
67
- gap: "1rem",
68
- };
69
-
70
- const sectionStyle: React.CSSProperties = {
71
- backgroundColor: "#f0fdf4",
72
- padding: "1rem",
73
- borderRadius: "0.5rem",
74
- border: "1px solid #bbf7d0",
75
- };
76
-
77
- const headerStyle: React.CSSProperties = {
78
- display: "flex",
79
- alignItems: "center",
80
- gap: "0.5rem",
81
- marginBottom: "0.75rem",
82
- fontSize: "0.875rem",
83
- fontWeight: "600",
84
- color: "#16a34a",
85
- };
86
-
87
- const infoItemStyle: React.CSSProperties = {
88
- display: "flex",
89
- justifyContent: "space-between",
90
- alignItems: "center",
91
- padding: "0.5rem",
92
- backgroundColor: "#f8fafc",
93
- borderRadius: "0.25rem",
94
- fontSize: "0.75rem",
95
- color: "#475569",
96
- marginBottom: "0.5rem",
97
- };
98
-
99
- const labelStyle: React.CSSProperties = {
100
- fontWeight: "500",
101
- color: "#64748b",
102
- };
103
-
104
- const valueStyle: React.CSSProperties = {
105
- fontFamily: "monospace",
106
- backgroundColor: "#e2e8f0",
107
- padding: "0.125rem 0.375rem",
108
- borderRadius: "0.25rem",
109
- fontSize: "0.625rem",
110
- };
111
-
112
- const codeBlockStyle: React.CSSProperties = {
113
- backgroundColor: "#f1f5f9",
114
- border: "1px solid #e2e8f0",
115
- borderRadius: "0.375rem",
116
- padding: "0.75rem",
117
- marginTop: "0.5rem",
118
- fontSize: "0.75rem",
119
- fontFamily: "monospace",
120
- color: "#475569",
121
- maxHeight: "120px",
122
- overflowY: "auto",
123
- lineHeight: "1.4",
124
- whiteSpace: "pre-wrap",
125
- };
126
-
127
- const badgeStyle: React.CSSProperties = {
128
- display: "inline-flex",
129
- alignItems: "center",
130
- padding: "0.25rem 0.5rem",
131
- backgroundColor: "#dcfce7",
132
- color: "#16a34a",
133
- borderRadius: "0.375rem",
134
- fontSize: "0.75rem",
135
- fontWeight: "500",
136
- border: "1px solid #bbf7d0",
137
- };
138
-
139
- switch (event.type) {
140
- case "databaseCorrect":
141
- const prismaEvent = event as IAutoBeCorrectEventMovieProps["event"] & {
142
- type: "databaseCorrect";
143
- };
144
- return (
145
- <div style={containerStyle}>
146
- <div style={sectionStyle}>
147
- <div style={headerStyle}>
148
- 🗄️ <span>Database Schema Corrections</span>
149
- </div>
150
-
151
- <div style={infoItemStyle}>
152
- <span style={labelStyle}>Analysis Step:</span>
153
- <span style={valueStyle}>Step {prismaEvent.step}</span>
154
- </div>
155
-
156
- {prismaEvent.planning && (
157
- <div>
158
- <div style={labelStyle}>🎯 Correction Strategy:</div>
159
- <div style={codeBlockStyle}>{prismaEvent.planning}</div>
160
- </div>
161
- )}
162
-
163
- {prismaEvent.failure && (
164
- <div>
165
- <div style={labelStyle}>⚠️ Validation Issues:</div>
166
- <div style={codeBlockStyle}>
167
- {JSON.stringify(prismaEvent.failure, null, 2)}
168
- </div>
169
- </div>
170
- )}
171
-
172
- <div style={{ marginTop: "0.75rem" }}>
173
- <span style={badgeStyle}>✓ Schema Validated</span>
174
- </div>
175
- </div>
176
- </div>
177
- );
178
-
179
- case "testCorrect":
180
- const testEvent = event as IAutoBeCorrectEventMovieProps["event"] & {
181
- type: "testCorrect";
182
- };
183
- return (
184
- <div style={containerStyle}>
185
- <div style={sectionStyle}>
186
- <div style={headerStyle}>
187
- 🧪 <span>Test Suite Corrections</span>
188
- </div>
189
-
190
- <div style={infoItemStyle}>
191
- <span style={labelStyle}>Analysis Step:</span>
192
- <span style={valueStyle}>Step {testEvent.step}</span>
193
- </div>
194
-
195
- {testEvent.function?.location && (
196
- <div style={infoItemStyle}>
197
- <span style={labelStyle}>Test File:</span>
198
- <span style={valueStyle}>{testEvent.function.location}</span>
199
- </div>
200
- )}
201
-
202
- <div style={{ marginTop: "0.75rem" }}>
203
- <span style={badgeStyle}>✓ Tests Corrected</span>
204
- </div>
205
- </div>
206
- </div>
207
- );
208
-
209
- case "realizeCorrect":
210
- const realizeEvent = event as IAutoBeCorrectEventMovieProps["event"] & {
211
- type: "realizeCorrect";
212
- };
213
- return (
214
- <div style={containerStyle}>
215
- <div style={sectionStyle}>
216
- <div style={headerStyle}>
217
- ⚙️ <span>Implementation Corrections</span>
218
- </div>
219
-
220
- <div style={infoItemStyle}>
221
- <span style={labelStyle}>Analysis Step:</span>
222
- <span style={valueStyle}>Step {realizeEvent.step}</span>
223
- </div>
224
-
225
- <div style={infoItemStyle}>
226
- <span style={labelStyle}>File Location:</span>
227
- <span style={valueStyle}>{realizeEvent.function.location}</span>
228
- </div>
229
-
230
- {realizeEvent.function.content && (
231
- <div>
232
- <div style={labelStyle}>📄 Corrected Implementation:</div>
233
- <div style={codeBlockStyle}>
234
- {realizeEvent.function.content.slice(0, 500)}
235
- {realizeEvent.function.content.length > 500 && "..."}
236
- </div>
237
- </div>
238
- )}
239
-
240
- <div style={{ marginTop: "0.75rem" }}>
241
- <span style={badgeStyle}>✓ Implementation Fixed</span>
242
- </div>
243
- </div>
244
- </div>
245
- );
246
-
247
- case "realizeAuthorizationCorrect":
248
- const authEvent = event as IAutoBeCorrectEventMovieProps["event"] & {
249
- type: "realizeAuthorizationCorrect";
250
- };
251
- return (
252
- <div style={containerStyle}>
253
- <div style={sectionStyle}>
254
- <div style={headerStyle}>
255
- 🔐 <span>Authorization Corrections</span>
256
- </div>
257
-
258
- <div style={infoItemStyle}>
259
- <span style={labelStyle}>Analysis Step:</span>
260
- <span style={valueStyle}>Step {authEvent.step}</span>
261
- </div>
262
-
263
- {authEvent.authorization && (
264
- <div style={infoItemStyle}>
265
- <span style={labelStyle}>Authorization Module:</span>
266
- <span style={valueStyle}>
267
- {JSON.stringify(authEvent.authorization).slice(0, 50)}...
268
- </span>
269
- </div>
270
- )}
271
-
272
- {authEvent.result && (
273
- <div>
274
- <div style={labelStyle}>⚠️ Compilation Issues:</div>
275
- <div style={codeBlockStyle}>
276
- {JSON.stringify(authEvent.result, null, 2)}
277
- </div>
278
- </div>
279
- )}
280
-
281
- <div style={{ marginTop: "0.75rem" }}>
282
- <span style={badgeStyle}>✓ Authorization Secured</span>
283
- </div>
284
- </div>
285
- </div>
286
- );
287
-
288
- default:
289
- return null;
290
- }
291
- }
292
-
293
- /** Component for displaying correction events */
294
- export const AutoBeCorrectEventMovie = (
295
- props: IAutoBeCorrectEventMovieProps,
296
- ) => {
297
- const eventType = props.event.type;
298
- const config = getStepConfig(eventType);
299
- const eventDetails = getEventDetails(props.event);
300
-
301
- return (
302
- <EventCard variant="success">
303
- <EventHeader
304
- title={config.title}
305
- subtitle={config.description}
306
- timestamp={props.event.created_at}
307
- iconType="success"
308
- />
309
- <EventContent>
310
- <div
311
- style={{
312
- display: "flex",
313
- flexDirection: "column",
314
- gap: "0.75rem",
315
- }}
316
- >
317
- <div
318
- style={{
319
- display: "flex",
320
- alignItems: "center",
321
- gap: "0.5rem",
322
- }}
323
- >
324
- <span
325
- style={{
326
- color: "#16a34a",
327
- fontWeight: "600",
328
- fontSize: "0.875rem",
329
- }}
330
- >
331
- ✓ Correction Applied
332
- </span>
333
- </div>
334
-
335
- <div
336
- style={{
337
- fontSize: "0.875rem",
338
- color: "#475569",
339
- lineHeight: "1.5",
340
- }}
341
- >
342
- The system has automatically detected and corrected issues in the
343
- code. The corrected version is now ready for the next step.
344
- </div>
345
-
346
- {/* Additional details based on event type */}
347
- {eventDetails}
348
- </div>
349
- </EventContent>
350
- </EventCard>
351
- );
352
- };
353
-
354
- export default AutoBeCorrectEventMovie;
1
+ import {
2
+ AutoBeDatabaseCorrectEvent,
3
+ AutoBeRealizeAuthorizationCorrectEvent,
4
+ AutoBeRealizeCorrectEvent,
5
+ AutoBeTestCorrectEvent,
6
+ } from "@autobe/interface";
7
+ import React from "react";
8
+
9
+ import { EventCard, EventContent, EventHeader } from "./common";
10
+
11
+ /** Props interface for AutoBeCorrectEventMovie component */
12
+ export interface IAutoBeCorrectEventMovieProps {
13
+ /** Correct event to display */
14
+ event:
15
+ | AutoBeDatabaseCorrectEvent
16
+ | AutoBeTestCorrectEvent
17
+ | AutoBeRealizeCorrectEvent
18
+ | AutoBeRealizeAuthorizationCorrectEvent;
19
+ }
20
+
21
+ /** Event type definition */
22
+ type CorrectEventType =
23
+ | "databaseCorrect"
24
+ | "testCorrect"
25
+ | "realizeCorrect"
26
+ | "realizeAuthorizationCorrect";
27
+
28
+ /** Get step configuration based on event type */
29
+ function getStepConfig(eventType: CorrectEventType): {
30
+ title: string;
31
+ description: string;
32
+ } {
33
+ switch (eventType) {
34
+ case "databaseCorrect":
35
+ return {
36
+ title: "Prisma Schema Corrected",
37
+ description: "Database schema has been successfully corrected",
38
+ };
39
+ case "testCorrect":
40
+ return {
41
+ title: "Test Code Corrected",
42
+ description: "Test implementation has been successfully corrected",
43
+ };
44
+ case "realizeCorrect":
45
+ return {
46
+ title: "Implementation Corrected",
47
+ description: "API implementation has been successfully corrected",
48
+ };
49
+ case "realizeAuthorizationCorrect":
50
+ return {
51
+ title: "Authorization Corrected",
52
+ description: "Authorization logic has been successfully corrected",
53
+ };
54
+ default:
55
+ eventType satisfies never;
56
+ throw new Error(`Unknown event type: ${eventType}`);
57
+ }
58
+ }
59
+
60
+ /** Get additional details section based on event type */
61
+ function getEventDetails(
62
+ event: IAutoBeCorrectEventMovieProps["event"],
63
+ ): React.ReactElement | null {
64
+ const containerStyle: React.CSSProperties = {
65
+ display: "flex",
66
+ flexDirection: "column",
67
+ gap: "1rem",
68
+ };
69
+
70
+ const sectionStyle: React.CSSProperties = {
71
+ backgroundColor: "#f0fdf4",
72
+ padding: "1rem",
73
+ borderRadius: "0.5rem",
74
+ border: "1px solid #bbf7d0",
75
+ };
76
+
77
+ const headerStyle: React.CSSProperties = {
78
+ display: "flex",
79
+ alignItems: "center",
80
+ gap: "0.5rem",
81
+ marginBottom: "0.75rem",
82
+ fontSize: "0.875rem",
83
+ fontWeight: "600",
84
+ color: "#16a34a",
85
+ };
86
+
87
+ const infoItemStyle: React.CSSProperties = {
88
+ display: "flex",
89
+ justifyContent: "space-between",
90
+ alignItems: "center",
91
+ padding: "0.5rem",
92
+ backgroundColor: "#f8fafc",
93
+ borderRadius: "0.25rem",
94
+ fontSize: "0.75rem",
95
+ color: "#475569",
96
+ marginBottom: "0.5rem",
97
+ };
98
+
99
+ const labelStyle: React.CSSProperties = {
100
+ fontWeight: "500",
101
+ color: "#64748b",
102
+ };
103
+
104
+ const valueStyle: React.CSSProperties = {
105
+ fontFamily: "monospace",
106
+ backgroundColor: "#e2e8f0",
107
+ padding: "0.125rem 0.375rem",
108
+ borderRadius: "0.25rem",
109
+ fontSize: "0.625rem",
110
+ };
111
+
112
+ const codeBlockStyle: React.CSSProperties = {
113
+ backgroundColor: "#f1f5f9",
114
+ border: "1px solid #e2e8f0",
115
+ borderRadius: "0.375rem",
116
+ padding: "0.75rem",
117
+ marginTop: "0.5rem",
118
+ fontSize: "0.75rem",
119
+ fontFamily: "monospace",
120
+ color: "#475569",
121
+ maxHeight: "120px",
122
+ overflowY: "auto",
123
+ lineHeight: "1.4",
124
+ whiteSpace: "pre-wrap",
125
+ };
126
+
127
+ const badgeStyle: React.CSSProperties = {
128
+ display: "inline-flex",
129
+ alignItems: "center",
130
+ padding: "0.25rem 0.5rem",
131
+ backgroundColor: "#dcfce7",
132
+ color: "#16a34a",
133
+ borderRadius: "0.375rem",
134
+ fontSize: "0.75rem",
135
+ fontWeight: "500",
136
+ border: "1px solid #bbf7d0",
137
+ };
138
+
139
+ switch (event.type) {
140
+ case "databaseCorrect":
141
+ const prismaEvent = event as IAutoBeCorrectEventMovieProps["event"] & {
142
+ type: "databaseCorrect";
143
+ };
144
+ return (
145
+ <div style={containerStyle}>
146
+ <div style={sectionStyle}>
147
+ <div style={headerStyle}>
148
+ 🗄️ <span>Database Schema Corrections</span>
149
+ </div>
150
+
151
+ <div style={infoItemStyle}>
152
+ <span style={labelStyle}>Analysis Step:</span>
153
+ <span style={valueStyle}>Step {prismaEvent.step}</span>
154
+ </div>
155
+
156
+ {prismaEvent.planning && (
157
+ <div>
158
+ <div style={labelStyle}>🎯 Correction Strategy:</div>
159
+ <div style={codeBlockStyle}>{prismaEvent.planning}</div>
160
+ </div>
161
+ )}
162
+
163
+ {prismaEvent.failure && (
164
+ <div>
165
+ <div style={labelStyle}>⚠️ Validation Issues:</div>
166
+ <div style={codeBlockStyle}>
167
+ {JSON.stringify(prismaEvent.failure, null, 2)}
168
+ </div>
169
+ </div>
170
+ )}
171
+
172
+ <div style={{ marginTop: "0.75rem" }}>
173
+ <span style={badgeStyle}>✓ Schema Validated</span>
174
+ </div>
175
+ </div>
176
+ </div>
177
+ );
178
+
179
+ case "testCorrect":
180
+ const testEvent = event as IAutoBeCorrectEventMovieProps["event"] & {
181
+ type: "testCorrect";
182
+ };
183
+ return (
184
+ <div style={containerStyle}>
185
+ <div style={sectionStyle}>
186
+ <div style={headerStyle}>
187
+ 🧪 <span>Test Suite Corrections</span>
188
+ </div>
189
+
190
+ <div style={infoItemStyle}>
191
+ <span style={labelStyle}>Analysis Step:</span>
192
+ <span style={valueStyle}>Step {testEvent.step}</span>
193
+ </div>
194
+
195
+ {testEvent.function?.location && (
196
+ <div style={infoItemStyle}>
197
+ <span style={labelStyle}>Test File:</span>
198
+ <span style={valueStyle}>{testEvent.function.location}</span>
199
+ </div>
200
+ )}
201
+
202
+ <div style={{ marginTop: "0.75rem" }}>
203
+ <span style={badgeStyle}>✓ Tests Corrected</span>
204
+ </div>
205
+ </div>
206
+ </div>
207
+ );
208
+
209
+ case "realizeCorrect":
210
+ const realizeEvent = event as IAutoBeCorrectEventMovieProps["event"] & {
211
+ type: "realizeCorrect";
212
+ };
213
+ return (
214
+ <div style={containerStyle}>
215
+ <div style={sectionStyle}>
216
+ <div style={headerStyle}>
217
+ ⚙️ <span>Implementation Corrections</span>
218
+ </div>
219
+
220
+ <div style={infoItemStyle}>
221
+ <span style={labelStyle}>Analysis Step:</span>
222
+ <span style={valueStyle}>Step {realizeEvent.step}</span>
223
+ </div>
224
+
225
+ <div style={infoItemStyle}>
226
+ <span style={labelStyle}>File Location:</span>
227
+ <span style={valueStyle}>{realizeEvent.function.location}</span>
228
+ </div>
229
+
230
+ {realizeEvent.function.content && (
231
+ <div>
232
+ <div style={labelStyle}>📄 Corrected Implementation:</div>
233
+ <div style={codeBlockStyle}>
234
+ {realizeEvent.function.content.slice(0, 500)}
235
+ {realizeEvent.function.content.length > 500 && "..."}
236
+ </div>
237
+ </div>
238
+ )}
239
+
240
+ <div style={{ marginTop: "0.75rem" }}>
241
+ <span style={badgeStyle}>✓ Implementation Fixed</span>
242
+ </div>
243
+ </div>
244
+ </div>
245
+ );
246
+
247
+ case "realizeAuthorizationCorrect":
248
+ const authEvent = event as IAutoBeCorrectEventMovieProps["event"] & {
249
+ type: "realizeAuthorizationCorrect";
250
+ };
251
+ return (
252
+ <div style={containerStyle}>
253
+ <div style={sectionStyle}>
254
+ <div style={headerStyle}>
255
+ 🔐 <span>Authorization Corrections</span>
256
+ </div>
257
+
258
+ <div style={infoItemStyle}>
259
+ <span style={labelStyle}>Analysis Step:</span>
260
+ <span style={valueStyle}>Step {authEvent.step}</span>
261
+ </div>
262
+
263
+ {authEvent.authorization && (
264
+ <div style={infoItemStyle}>
265
+ <span style={labelStyle}>Authorization Module:</span>
266
+ <span style={valueStyle}>
267
+ {JSON.stringify(authEvent.authorization).slice(0, 50)}...
268
+ </span>
269
+ </div>
270
+ )}
271
+
272
+ {authEvent.result && (
273
+ <div>
274
+ <div style={labelStyle}>⚠️ Compilation Issues:</div>
275
+ <div style={codeBlockStyle}>
276
+ {JSON.stringify(authEvent.result, null, 2)}
277
+ </div>
278
+ </div>
279
+ )}
280
+
281
+ <div style={{ marginTop: "0.75rem" }}>
282
+ <span style={badgeStyle}>✓ Authorization Secured</span>
283
+ </div>
284
+ </div>
285
+ </div>
286
+ );
287
+
288
+ default:
289
+ return null;
290
+ }
291
+ }
292
+
293
+ /** Component for displaying correction events */
294
+ export const AutoBeCorrectEventMovie = (
295
+ props: IAutoBeCorrectEventMovieProps,
296
+ ) => {
297
+ const eventType = props.event.type;
298
+ const config = getStepConfig(eventType);
299
+ const eventDetails = getEventDetails(props.event);
300
+
301
+ return (
302
+ <EventCard variant="success">
303
+ <EventHeader
304
+ title={config.title}
305
+ subtitle={config.description}
306
+ timestamp={props.event.created_at}
307
+ iconType="success"
308
+ />
309
+ <EventContent>
310
+ <div
311
+ style={{
312
+ display: "flex",
313
+ flexDirection: "column",
314
+ gap: "0.75rem",
315
+ }}
316
+ >
317
+ <div
318
+ style={{
319
+ display: "flex",
320
+ alignItems: "center",
321
+ gap: "0.5rem",
322
+ }}
323
+ >
324
+ <span
325
+ style={{
326
+ color: "#16a34a",
327
+ fontWeight: "600",
328
+ fontSize: "0.875rem",
329
+ }}
330
+ >
331
+ ✓ Correction Applied
332
+ </span>
333
+ </div>
334
+
335
+ <div
336
+ style={{
337
+ fontSize: "0.875rem",
338
+ color: "#475569",
339
+ lineHeight: "1.5",
340
+ }}
341
+ >
342
+ The system has automatically detected and corrected issues in the
343
+ code. The corrected version is now ready for the next step.
344
+ </div>
345
+
346
+ {/* Additional details based on event type */}
347
+ {eventDetails}
348
+ </div>
349
+ </EventContent>
350
+ </EventCard>
351
+ );
352
+ };
353
+
354
+ export default AutoBeCorrectEventMovie;