@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.
Files changed (151) hide show
  1. package/LICENSE +661 -661
  2. package/README.md +261 -0
  3. package/lib/components/AutoBeChatMain.js +5 -5
  4. package/lib/components/AutoBeChatMain.js.map +1 -1
  5. package/lib/components/AutoBeConfigModal.js +9 -9
  6. package/lib/components/AutoBeStatusModal.js +4 -4
  7. package/lib/components/AutoBeStatusModal.js.map +1 -1
  8. package/lib/components/AutoBeUserMessageMovie.d.ts +2 -2
  9. package/lib/components/common/ChatBubble.d.ts +2 -2
  10. package/lib/components/common/openai/OpenAIContent.d.ts +2 -2
  11. package/lib/components/common/openai/OpenAIContent.js.map +1 -1
  12. package/lib/components/common/openai/OpenAIUserAudioContent.js +1 -1
  13. package/lib/components/common/openai/OpenAIUserAudioContent.js.map +1 -1
  14. package/lib/components/common/openai/OpenAIUserFileContent.js +1 -1
  15. package/lib/components/common/openai/OpenAIUserFileContent.js.map +1 -1
  16. package/lib/components/common/openai/OpenAIUserImageContent.d.ts +2 -2
  17. package/lib/components/events/AutoBeCompleteEventMovie.d.ts +2 -2
  18. package/lib/components/events/AutoBeCompleteEventMovie.js +5 -5
  19. package/lib/components/events/AutoBeCompleteEventMovie.js.map +1 -1
  20. package/lib/components/events/AutoBeCorrectEventMovie.d.ts +2 -2
  21. package/lib/components/events/AutoBeCorrectEventMovie.js +4 -4
  22. package/lib/components/events/AutoBeCorrectEventMovie.js.map +1 -1
  23. package/lib/components/events/AutoBeEventMovie.js +38 -17
  24. package/lib/components/events/AutoBeEventMovie.js.map +1 -1
  25. package/lib/components/events/AutoBeProgressEventMovie.js +73 -13
  26. package/lib/components/events/AutoBeProgressEventMovie.js.map +1 -1
  27. package/lib/components/events/AutoBeScenarioEventMovie.d.ts +2 -2
  28. package/lib/components/events/AutoBeScenarioEventMovie.js +18 -5
  29. package/lib/components/events/AutoBeScenarioEventMovie.js.map +1 -1
  30. package/lib/components/events/AutoBeStartEventMovie.d.ts +2 -2
  31. package/lib/components/events/AutoBeStartEventMovie.js +2 -2
  32. package/lib/components/events/AutoBeStartEventMovie.js.map +1 -1
  33. package/lib/components/events/AutoBeValidateEventMovie.d.ts +2 -2
  34. package/lib/components/events/AutoBeValidateEventMovie.js +3 -11
  35. package/lib/components/events/AutoBeValidateEventMovie.js.map +1 -1
  36. package/lib/components/events/groups/CorrectEventGroup.d.ts +2 -2
  37. package/lib/components/events/groups/CorrectEventGroup.js +1 -1
  38. package/lib/components/events/groups/CorrectEventGroup.js.map +1 -1
  39. package/lib/components/events/groups/ValidateEventGroup.d.ts +2 -2
  40. package/lib/components/events/groups/ValidateEventGroup.js +1 -2
  41. package/lib/components/events/groups/ValidateEventGroup.js.map +1 -1
  42. package/lib/components/events/utils/eventGrouper.js +1 -2
  43. package/lib/components/events/utils/eventGrouper.js.map +1 -1
  44. package/lib/components/upload/AutoBeChatUploadBox.d.ts +3 -4
  45. package/lib/components/upload/AutoBeChatUploadBox.js +2 -1
  46. package/lib/components/upload/AutoBeChatUploadBox.js.map +1 -1
  47. package/lib/components/upload/AutoBeChatUploadSendButton.js +1 -1
  48. package/lib/components/upload/AutoBeChatUploadSendButton.js.map +1 -1
  49. package/lib/context/AutoBeAgentContext.d.ts +1 -3
  50. package/lib/context/AutoBeAgentContext.js +0 -4
  51. package/lib/context/AutoBeAgentContext.js.map +1 -1
  52. package/lib/hooks/useSessionStorage.d.ts +4 -0
  53. package/lib/hooks/useSessionStorage.js +16 -0
  54. package/lib/hooks/useSessionStorage.js.map +1 -0
  55. package/lib/index.d.ts +1 -0
  56. package/lib/index.js +1 -0
  57. package/lib/index.js.map +1 -1
  58. package/lib/strategy/AutoBeAgentSessionStorageStrategy.d.ts +10 -0
  59. package/lib/strategy/AutoBeAgentSessionStorageStrategy.js +117 -0
  60. package/lib/strategy/AutoBeAgentSessionStorageStrategy.js.map +1 -0
  61. package/lib/structure/AutoBeListener.js +91 -23
  62. package/lib/structure/AutoBeListener.js.map +1 -1
  63. package/lib/structure/AutoBeListenerState.d.ts +3 -3
  64. package/lib/structure/AutoBeListenerState.js +4 -4
  65. package/lib/structure/AutoBeListenerState.js.map +1 -1
  66. package/lib/structure/IAutoBeAgentSessionStorageStrategy.js +1 -1
  67. package/lib/structure/IAutoBeAgentSessionStorageStrategy.js.map +1 -1
  68. package/lib/utils/AutoBeFileUploader.d.ts +2 -2
  69. package/lib/utils/AutoBeFileUploader.js.map +1 -1
  70. package/package.json +3 -4
  71. package/src/components/AutoBeAssistantMessageMovie.tsx +22 -22
  72. package/src/components/AutoBeChatMain.tsx +376 -376
  73. package/src/components/AutoBeChatSidebar.tsx +414 -414
  74. package/src/components/AutoBeConfigButton.tsx +83 -83
  75. package/src/components/AutoBeConfigModal.tsx +443 -443
  76. package/src/components/AutoBeStatusButton.tsx +75 -75
  77. package/src/components/AutoBeStatusModal.tsx +486 -484
  78. package/src/components/AutoBeUserMessageMovie.tsx +27 -27
  79. package/src/components/common/ActionButton.tsx +205 -205
  80. package/src/components/common/ActionButtonGroup.tsx +80 -80
  81. package/src/components/common/AutoBeConfigInput.tsx +185 -185
  82. package/src/components/common/ChatBubble.tsx +119 -119
  83. package/src/components/common/Collapsible.tsx +95 -95
  84. package/src/components/common/CompactSessionIndicator.tsx +73 -73
  85. package/src/components/common/CompactSessionList.tsx +82 -82
  86. package/src/components/common/index.ts +8 -8
  87. package/src/components/common/openai/OpenAIContent.tsx +53 -53
  88. package/src/components/common/openai/OpenAIUserAudioContent.tsx +70 -70
  89. package/src/components/common/openai/OpenAIUserFileContent.tsx +76 -76
  90. package/src/components/common/openai/OpenAIUserImageContent.tsx +34 -34
  91. package/src/components/common/openai/OpenAIUserTextContent.tsx +15 -15
  92. package/src/components/common/openai/index.ts +5 -5
  93. package/src/components/events/AutoBeCompleteEventMovie.tsx +402 -402
  94. package/src/components/events/AutoBeCorrectEventMovie.tsx +354 -368
  95. package/src/components/events/AutoBeEventGroupMovie.tsx +18 -18
  96. package/src/components/events/AutoBeEventMovie.tsx +158 -139
  97. package/src/components/events/AutoBeProgressEventMovie.tsx +217 -157
  98. package/src/components/events/AutoBeScenarioEventMovie.tsx +135 -95
  99. package/src/components/events/AutoBeStartEventMovie.tsx +82 -82
  100. package/src/components/events/AutoBeValidateEventMovie.tsx +249 -286
  101. package/src/components/events/README.md +300 -300
  102. package/src/components/events/common/CollapsibleEventGroup.tsx +211 -211
  103. package/src/components/events/common/EventCard.tsx +61 -61
  104. package/src/components/events/common/EventContent.tsx +31 -31
  105. package/src/components/events/common/EventHeader.tsx +85 -85
  106. package/src/components/events/common/EventIcon.tsx +82 -82
  107. package/src/components/events/common/ProgressBar.tsx +64 -64
  108. package/src/components/events/common/index.ts +13 -13
  109. package/src/components/events/groups/CorrectEventGroup.tsx +183 -183
  110. package/src/components/events/groups/ValidateEventGroup.tsx +143 -146
  111. package/src/components/events/groups/index.ts +8 -8
  112. package/src/components/events/index.ts +16 -16
  113. package/src/components/events/utils/eventGrouper.tsx +116 -117
  114. package/src/components/events/utils/index.ts +1 -1
  115. package/src/components/index.ts +13 -13
  116. package/src/components/upload/AutoBeChatUploadBox.tsx +425 -424
  117. package/src/components/upload/AutoBeChatUploadSendButton.tsx +66 -66
  118. package/src/components/upload/AutoBeFileUploadBox.tsx +123 -123
  119. package/src/components/upload/AutoBeUploadConfig.ts +5 -5
  120. package/src/components/upload/AutoBeVoiceRecoderButton.tsx +100 -100
  121. package/src/components/upload/index.ts +5 -5
  122. package/src/constant/color.ts +28 -28
  123. package/src/context/AutoBeAgentContext.tsx +245 -258
  124. package/src/context/AutoBeAgentSessionList.tsx +58 -58
  125. package/src/context/SearchParamsContext.tsx +49 -49
  126. package/src/hooks/index.ts +3 -3
  127. package/src/hooks/useEscapeKey.ts +24 -24
  128. package/src/hooks/useIsomorphicLayoutEffect.ts +8 -8
  129. package/src/hooks/useMediaQuery.ts +73 -73
  130. package/src/hooks/useSessionStorage.ts +10 -0
  131. package/src/icons/Receipt.tsx +74 -74
  132. package/src/index.ts +9 -8
  133. package/src/strategy/AutoBeAgentSessionStorageStrategy.ts +127 -0
  134. package/src/structure/AutoBeListener.ts +373 -304
  135. package/src/structure/AutoBeListenerState.ts +53 -53
  136. package/src/structure/IAutoBeAgentSessionStorageStrategy.ts +87 -87
  137. package/src/structure/IAutoBeEventGroup.ts +6 -6
  138. package/src/structure/index.ts +4 -4
  139. package/src/types/config.ts +44 -44
  140. package/src/types/index.ts +1 -1
  141. package/src/utils/AutoBeFileUploader.ts +279 -279
  142. package/src/utils/AutoBeVoiceRecorder.ts +95 -95
  143. package/src/utils/__tests__/crypto.test.ts +286 -286
  144. package/src/utils/__tests__/storage.test.ts +229 -229
  145. package/src/utils/crypto.ts +95 -95
  146. package/src/utils/index.ts +6 -6
  147. package/src/utils/number.ts +17 -17
  148. package/src/utils/storage.ts +96 -96
  149. package/src/utils/time.ts +14 -14
  150. package/tsconfig.json +9 -9
  151. package/vitest.config.ts +15 -15
@@ -1,286 +1,249 @@
1
- import {
2
- AutoBeInterfaceOperationReviewEvent,
3
- AutoBePrismaInsufficientEvent,
4
- AutoBePrismaValidateEvent,
5
- AutoBeRealizeAuthorizationValidateEvent,
6
- AutoBeRealizeValidateEvent,
7
- AutoBeTestValidateEvent,
8
- } from "@autobe/interface";
9
- import { JSX } from "react";
10
-
11
- import { EventCard, EventContent, EventHeader } from "./common";
12
-
13
- export interface IAutoBeValidateEventMovieProps {
14
- event:
15
- | AutoBePrismaInsufficientEvent
16
- | AutoBePrismaValidateEvent
17
- | AutoBeInterfaceOperationReviewEvent
18
- | AutoBeTestValidateEvent
19
- | AutoBeRealizeValidateEvent
20
- | AutoBeRealizeAuthorizationValidateEvent;
21
- }
22
-
23
- export const AutoBeValidateEventMovie = (
24
- props: IAutoBeValidateEventMovieProps,
25
- ) => {
26
- const { event } = props;
27
- const { title, description, isError, step, isSuccess } = getState(event);
28
-
29
- const getCardVariant = () => {
30
- if (isSuccess) return "success";
31
- if (isError) return "warning";
32
- return "warning";
33
- };
34
-
35
- const getIconType = () => {
36
- if (isSuccess) return "success";
37
- if (isError) return "warning";
38
- return "warning";
39
- };
40
-
41
- return (
42
- <EventCard variant={getCardVariant()}>
43
- <EventHeader
44
- title={title}
45
- timestamp={event.created_at}
46
- iconType={getIconType()}
47
- step={step}
48
- />
49
- <EventContent>{description}</EventContent>
50
- </EventCard>
51
- );
52
- };
53
-
54
- export default AutoBeValidateEventMovie;
55
-
56
- interface IState {
57
- title: string;
58
- description: string | JSX.Element;
59
- isError: boolean;
60
- isSuccess: boolean;
61
- step?: number;
62
- }
63
-
64
- function getState(event: IAutoBeValidateEventMovieProps["event"]): IState {
65
- switch (event.type) {
66
- case "prismaValidate":
67
- return {
68
- title: "Prisma Validation Failed",
69
- description: (
70
- <>
71
- Database schema validation encountered errors that require
72
- correction.
73
- <br />
74
- <br />
75
- <strong>Error Details:</strong>
76
- <br />
77
- {event.result.errors.length > 0 && (
78
- <>
79
- {event.result.errors.slice(0, 3).map((error, idx) => (
80
- <div key={idx} style={{ marginTop: "0.25rem" }}>
81
- • {error.message}
82
- </div>
83
- ))}
84
- </>
85
- )}
86
- <br />
87
- <strong>Failed Schemas:</strong> {Object.keys(event.schemas).length}{" "}
88
- file(s)
89
- </>
90
- ),
91
- isError: true,
92
- isSuccess: false,
93
- step: event.step,
94
- };
95
- case "testValidate":
96
- const isTestSuccess = event.result.type === "success";
97
- return {
98
- title: isTestSuccess
99
- ? "Test Validation Successful"
100
- : "Test Validation Failed",
101
- description: (
102
- <>
103
- Test file validation completed.
104
- <br />
105
- <br />
106
- <strong>File:</strong> {event.file.location}
107
- <br />
108
- <strong>Status:</strong> {isTestSuccess ? "Success" : "Failed"}
109
- {!isTestSuccess && (
110
- <>
111
- <br />
112
- <br />
113
- <strong>Compilation Issues:</strong>
114
- <br />
115
- {event.result.type === "failure" &&
116
- event.result.diagnostics
117
- .slice(0, 3)
118
- .map((diagnostic, idx) => (
119
- <div key={idx} style={{ marginTop: "0.25rem" }}>
120
- • {diagnostic.messageText}
121
- </div>
122
- ))}
123
- {event.result.type === "exception" && (
124
- <div style={{ marginTop: "0.25rem" }}>
125
- • Exception occurred during compilation
126
- </div>
127
- )}
128
- </>
129
- )}
130
- </>
131
- ),
132
- isError: !isTestSuccess,
133
- isSuccess: isTestSuccess,
134
- step: event.step,
135
- };
136
- case "realizeValidate":
137
- return {
138
- title: "Implementation Validation Failed",
139
- description: (
140
- <>
141
- Implementation code compilation encountered errors that need
142
- correction.
143
- <br />
144
- <br />
145
- <strong>Failed Files:</strong> {Object.keys(event.files).length}{" "}
146
- file(s)
147
- <br />
148
- <br />
149
- <strong>Error Type:</strong>{" "}
150
- {event.result.type === "failure"
151
- ? "Compilation Error"
152
- : "Runtime Exception"}
153
- <br />
154
- {event.result.type === "failure" &&
155
- event.result.diagnostics.length > 0 && (
156
- <>
157
- <br />
158
- <strong>First Error:</strong>
159
- <br />
160
- {event.result.diagnostics[0].messageText}
161
- </>
162
- )}
163
- </>
164
- ),
165
- isError: true,
166
- isSuccess: false,
167
- step: event.step,
168
- };
169
- case "realizeAuthorizationValidate":
170
- const isAuthSuccess = event.result.type === "success";
171
- return {
172
- title: isAuthSuccess
173
- ? "Authorization Validation Successful"
174
- : "Authorization Validation Failed",
175
- description: (
176
- <>
177
- Authorization implementation validation completed.
178
- <br />
179
- <br />
180
- <strong>Actor:</strong> {event.authorization.actor.name}(
181
- {event.authorization.actor.description})
182
- <br />
183
- <strong>Status:</strong> {isAuthSuccess ? "Success" : "Failed"}
184
- {!isAuthSuccess && (
185
- <>
186
- <br />
187
- <br />
188
- <strong>Validation Issues:</strong>
189
- <br />
190
- {event.result.type === "failure" &&
191
- event.result.diagnostics
192
- .slice(0, 2)
193
- .map((diagnostic, idx) => (
194
- <div key={idx} style={{ marginTop: "0.25rem" }}>
195
- • {diagnostic.messageText}
196
- </div>
197
- ))}
198
- {event.result.type === "exception" && (
199
- <div style={{ marginTop: "0.25rem" }}>
200
- • Exception occurred during validation
201
- </div>
202
- )}
203
- </>
204
- )}
205
- </>
206
- ),
207
- isError: !isAuthSuccess,
208
- isSuccess: isAuthSuccess,
209
- step: event.step,
210
- };
211
- case "prismaInsufficient":
212
- return {
213
- title: "Prisma Model Generation Insufficient",
214
- description: (
215
- <>
216
- Prisma model generation was incomplete for the assigned component.
217
- <br />
218
- <br />
219
- <strong>Component:</strong> {event.component.namespace}
220
- <br />
221
- <strong>Generated Models:</strong> {event.actual.length}
222
- <br />
223
- <strong>Missing Models:</strong> {event.missed.length}
224
- <br />
225
- <br />
226
- {event.missed.length > 0 && (
227
- <>
228
- <strong>Missed Tables:</strong>
229
- <br />
230
- {event.missed.slice(0, 5).map((table: string, idx: number) => (
231
- <div key={idx} style={{ marginTop: "0.25rem" }}>
232
- {table}
233
- </div>
234
- ))}
235
- {event.missed.length > 5 && (
236
- <div style={{ marginTop: "0.25rem" }}>
237
- ... and {event.missed.length - 5} more
238
- </div>
239
- )}
240
- </>
241
- )}
242
- </>
243
- ),
244
- isError: true,
245
- isSuccess: false,
246
- step: undefined, // prismaInsufficient doesn't have step
247
- };
248
- case "interfaceOperationReview":
249
- return {
250
- title: "Interface Operations Review",
251
- description: (
252
- <>
253
- API operations are being reviewed for quality and consistency.
254
- <br />
255
- <br />
256
- <strong>Operations Count:</strong> {event.operations.length}
257
- <br />
258
- <strong>Status:</strong> Review in progress
259
- <br />
260
- <br />
261
- <strong>Review Summary:</strong>
262
- <br />
263
- <div
264
- style={{
265
- maxHeight: "100px",
266
- overflow: "hidden",
267
- fontSize: "0.75rem",
268
- color: "#64748b",
269
- marginTop: "0.5rem",
270
- }}
271
- >
272
- {event.review.length > 200
273
- ? `${event.review.substring(0, 200)}...`
274
- : event.review}
275
- </div>
276
- </>
277
- ),
278
- isError: false,
279
- isSuccess: true,
280
- step: event.step,
281
- };
282
- default:
283
- event satisfies never;
284
- throw new Error("Unknown validation event type");
285
- }
286
- }
1
+ import {
2
+ AutoBeDatabaseValidateEvent,
3
+ AutoBeInterfaceOperationReviewEvent,
4
+ AutoBeRealizeAuthorizationValidateEvent,
5
+ AutoBeRealizeValidateEvent,
6
+ AutoBeTestValidateEvent,
7
+ } from "@autobe/interface";
8
+ import { JSX } from "react";
9
+
10
+ import { EventCard, EventContent, EventHeader } from "./common";
11
+
12
+ export interface IAutoBeValidateEventMovieProps {
13
+ event:
14
+ | AutoBeDatabaseValidateEvent
15
+ | AutoBeInterfaceOperationReviewEvent
16
+ | AutoBeTestValidateEvent
17
+ | AutoBeRealizeValidateEvent
18
+ | AutoBeRealizeAuthorizationValidateEvent;
19
+ }
20
+
21
+ export const AutoBeValidateEventMovie = (
22
+ props: IAutoBeValidateEventMovieProps,
23
+ ) => {
24
+ const { event } = props;
25
+ const { title, description, isError, step, isSuccess } = getState(event);
26
+
27
+ const getCardVariant = () => {
28
+ if (isSuccess) return "success";
29
+ if (isError) return "warning";
30
+ return "warning";
31
+ };
32
+
33
+ const getIconType = () => {
34
+ if (isSuccess) return "success";
35
+ if (isError) return "warning";
36
+ return "warning";
37
+ };
38
+
39
+ return (
40
+ <EventCard variant={getCardVariant()}>
41
+ <EventHeader
42
+ title={title}
43
+ timestamp={event.created_at}
44
+ iconType={getIconType()}
45
+ step={step}
46
+ />
47
+ <EventContent>{description}</EventContent>
48
+ </EventCard>
49
+ );
50
+ };
51
+
52
+ export default AutoBeValidateEventMovie;
53
+
54
+ interface IState {
55
+ title: string;
56
+ description: string | JSX.Element;
57
+ isError: boolean;
58
+ isSuccess: boolean;
59
+ step?: number;
60
+ }
61
+
62
+ function getState(event: IAutoBeValidateEventMovieProps["event"]): IState {
63
+ switch (event.type) {
64
+ case "databaseValidate":
65
+ return {
66
+ title: "Prisma Validation Failed",
67
+ description: (
68
+ <>
69
+ Database schema validation encountered errors that require
70
+ correction.
71
+ <br />
72
+ <br />
73
+ <strong>Error Details:</strong>
74
+ <br />
75
+ {event.result.errors.length > 0 && (
76
+ <>
77
+ {event.result.errors.slice(0, 3).map((error, idx) => (
78
+ <div key={idx} style={{ marginTop: "0.25rem" }}>
79
+ {error.message}
80
+ </div>
81
+ ))}
82
+ </>
83
+ )}
84
+ <br />
85
+ <strong>Failed Schemas:</strong> {Object.keys(event.schemas).length}{" "}
86
+ file(s)
87
+ </>
88
+ ),
89
+ isError: true,
90
+ isSuccess: false,
91
+ step: event.step,
92
+ };
93
+ case "testValidate":
94
+ const isTestSuccess = event.result.type === "success";
95
+ return {
96
+ title: isTestSuccess
97
+ ? "Test Validation Successful"
98
+ : "Test Validation Failed",
99
+ description: (
100
+ <>
101
+ Test file validation completed.
102
+ <br />
103
+ <br />
104
+ <strong>Function:</strong> {event.function.location}
105
+ <br />
106
+ <strong>Status:</strong> {isTestSuccess ? "Success" : "Failed"}
107
+ {!isTestSuccess && (
108
+ <>
109
+ <br />
110
+ <br />
111
+ <strong>Compilation Issues:</strong>
112
+ <br />
113
+ {event.result.type === "failure" &&
114
+ event.result.diagnostics
115
+ .slice(0, 3)
116
+ .map((diagnostic, idx) => (
117
+ <div key={idx} style={{ marginTop: "0.25rem" }}>
118
+ • {diagnostic.messageText}
119
+ </div>
120
+ ))}
121
+ {event.result.type === "exception" && (
122
+ <div style={{ marginTop: "0.25rem" }}>
123
+ Exception occurred during compilation
124
+ </div>
125
+ )}
126
+ </>
127
+ )}
128
+ </>
129
+ ),
130
+ isError: !isTestSuccess,
131
+ isSuccess: isTestSuccess,
132
+ step: event.step,
133
+ };
134
+ case "realizeValidate":
135
+ return {
136
+ title: "Implementation Validation Failed",
137
+ description: (
138
+ <>
139
+ Implementation code compilation encountered errors that need
140
+ correction.
141
+ <br />
142
+ <br />
143
+ <strong>Failed Files:</strong> {Object.keys(event.files).length}{" "}
144
+ file(s)
145
+ <br />
146
+ <br />
147
+ <strong>Error Type:</strong>{" "}
148
+ {event.result.type === "failure"
149
+ ? "Compilation Error"
150
+ : "Runtime Exception"}
151
+ <br />
152
+ {event.result.type === "failure" &&
153
+ event.result.diagnostics.length > 0 && (
154
+ <>
155
+ <br />
156
+ <strong>First Error:</strong>
157
+ <br />
158
+ {event.result.diagnostics[0].messageText}
159
+ </>
160
+ )}
161
+ </>
162
+ ),
163
+ isError: true,
164
+ isSuccess: false,
165
+ step: event.step,
166
+ };
167
+ case "realizeAuthorizationValidate":
168
+ const isAuthSuccess = event.result.type === "success";
169
+ return {
170
+ title: isAuthSuccess
171
+ ? "Authorization Validation Successful"
172
+ : "Authorization Validation Failed",
173
+ description: (
174
+ <>
175
+ Authorization implementation validation completed.
176
+ <br />
177
+ <br />
178
+ <strong>Actor:</strong> {event.authorization.actor.name}(
179
+ {event.authorization.actor.description})
180
+ <br />
181
+ <strong>Status:</strong> {isAuthSuccess ? "Success" : "Failed"}
182
+ {!isAuthSuccess && (
183
+ <>
184
+ <br />
185
+ <br />
186
+ <strong>Validation Issues:</strong>
187
+ <br />
188
+ {event.result.type === "failure" &&
189
+ event.result.diagnostics
190
+ .slice(0, 2)
191
+ .map((diagnostic, idx) => (
192
+ <div key={idx} style={{ marginTop: "0.25rem" }}>
193
+ • {diagnostic.messageText}
194
+ </div>
195
+ ))}
196
+ {event.result.type === "exception" && (
197
+ <div style={{ marginTop: "0.25rem" }}>
198
+ Exception occurred during validation
199
+ </div>
200
+ )}
201
+ </>
202
+ )}
203
+ </>
204
+ ),
205
+ isError: !isAuthSuccess,
206
+ isSuccess: isAuthSuccess,
207
+ step: event.step,
208
+ };
209
+ case "interfaceOperationReview":
210
+ return {
211
+ title: "Interface Operations Review",
212
+ description: (
213
+ <>
214
+ API operations are being reviewed for quality and consistency.
215
+ <br />
216
+ <br />
217
+ <strong>Method:</strong> {event.operation.method.toUpperCase()}
218
+ <br />
219
+ <strong>Path:</strong> {event.operation.path}
220
+ <br />
221
+ <strong>Status:</strong> Review in progress
222
+ <br />
223
+ <br />
224
+ <strong>Review Summary:</strong>
225
+ <br />
226
+ <div
227
+ style={{
228
+ maxHeight: "100px",
229
+ overflow: "hidden",
230
+ fontSize: "0.75rem",
231
+ color: "#64748b",
232
+ marginTop: "0.5rem",
233
+ }}
234
+ >
235
+ {event.review.length > 200
236
+ ? `${event.review.substring(0, 200)}...`
237
+ : event.review}
238
+ </div>
239
+ </>
240
+ ),
241
+ isError: false,
242
+ isSuccess: true,
243
+ step: event.step,
244
+ };
245
+ default:
246
+ event satisfies never;
247
+ throw new Error("Unknown validation event type");
248
+ }
249
+ }