@autobe/ui 0.30.0-dev.20260315 → 0.30.0

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 (86) hide show
  1. package/LICENSE +661 -661
  2. package/lib/components/AutoBeChatMain.js +5 -5
  3. package/lib/components/AutoBeConfigModal.js +9 -9
  4. package/package.json +2 -2
  5. package/src/components/AutoBeAssistantMessageMovie.tsx +22 -22
  6. package/src/components/AutoBeChatMain.tsx +376 -376
  7. package/src/components/AutoBeChatSidebar.tsx +414 -414
  8. package/src/components/AutoBeConfigButton.tsx +83 -83
  9. package/src/components/AutoBeConfigModal.tsx +443 -443
  10. package/src/components/AutoBeStatusButton.tsx +75 -75
  11. package/src/components/AutoBeStatusModal.tsx +486 -486
  12. package/src/components/AutoBeUserMessageMovie.tsx +27 -27
  13. package/src/components/common/ActionButton.tsx +205 -205
  14. package/src/components/common/ActionButtonGroup.tsx +80 -80
  15. package/src/components/common/AutoBeConfigInput.tsx +185 -185
  16. package/src/components/common/ChatBubble.tsx +119 -119
  17. package/src/components/common/Collapsible.tsx +95 -95
  18. package/src/components/common/CompactSessionIndicator.tsx +73 -73
  19. package/src/components/common/CompactSessionList.tsx +82 -82
  20. package/src/components/common/index.ts +8 -8
  21. package/src/components/common/openai/OpenAIContent.tsx +53 -53
  22. package/src/components/common/openai/OpenAIUserAudioContent.tsx +70 -70
  23. package/src/components/common/openai/OpenAIUserFileContent.tsx +76 -76
  24. package/src/components/common/openai/OpenAIUserImageContent.tsx +34 -34
  25. package/src/components/common/openai/OpenAIUserTextContent.tsx +15 -15
  26. package/src/components/common/openai/index.ts +5 -5
  27. package/src/components/events/AutoBeCompleteEventMovie.tsx +402 -402
  28. package/src/components/events/AutoBeCorrectEventMovie.tsx +354 -354
  29. package/src/components/events/AutoBeEventGroupMovie.tsx +18 -18
  30. package/src/components/events/AutoBeEventMovie.tsx +158 -158
  31. package/src/components/events/AutoBeProgressEventMovie.tsx +217 -217
  32. package/src/components/events/AutoBeScenarioEventMovie.tsx +135 -135
  33. package/src/components/events/AutoBeStartEventMovie.tsx +82 -82
  34. package/src/components/events/AutoBeValidateEventMovie.tsx +249 -249
  35. package/src/components/events/README.md +300 -300
  36. package/src/components/events/common/CollapsibleEventGroup.tsx +211 -211
  37. package/src/components/events/common/EventCard.tsx +61 -61
  38. package/src/components/events/common/EventContent.tsx +31 -31
  39. package/src/components/events/common/EventHeader.tsx +85 -85
  40. package/src/components/events/common/EventIcon.tsx +82 -82
  41. package/src/components/events/common/ProgressBar.tsx +64 -64
  42. package/src/components/events/common/index.ts +13 -13
  43. package/src/components/events/groups/CorrectEventGroup.tsx +183 -183
  44. package/src/components/events/groups/ValidateEventGroup.tsx +143 -143
  45. package/src/components/events/groups/index.ts +8 -8
  46. package/src/components/events/index.ts +16 -16
  47. package/src/components/events/utils/eventGrouper.tsx +116 -116
  48. package/src/components/events/utils/index.ts +1 -1
  49. package/src/components/index.ts +13 -13
  50. package/src/components/upload/AutoBeChatUploadBox.tsx +425 -425
  51. package/src/components/upload/AutoBeChatUploadSendButton.tsx +66 -66
  52. package/src/components/upload/AutoBeFileUploadBox.tsx +123 -123
  53. package/src/components/upload/AutoBeUploadConfig.ts +5 -5
  54. package/src/components/upload/AutoBeVoiceRecoderButton.tsx +100 -100
  55. package/src/components/upload/index.ts +5 -5
  56. package/src/constant/color.ts +28 -28
  57. package/src/context/AutoBeAgentContext.tsx +245 -245
  58. package/src/context/AutoBeAgentSessionList.tsx +58 -58
  59. package/src/context/SearchParamsContext.tsx +49 -49
  60. package/src/hooks/index.ts +3 -3
  61. package/src/hooks/useEscapeKey.ts +24 -24
  62. package/src/hooks/useIsomorphicLayoutEffect.ts +8 -8
  63. package/src/hooks/useMediaQuery.ts +73 -73
  64. package/src/hooks/useSessionStorage.ts +10 -10
  65. package/src/icons/Receipt.tsx +74 -74
  66. package/src/index.ts +9 -9
  67. package/src/strategy/AutoBeAgentSessionStorageStrategy.ts +127 -127
  68. package/src/structure/AutoBeListener.ts +373 -373
  69. package/src/structure/AutoBeListenerState.ts +53 -53
  70. package/src/structure/IAutoBeAgentSessionStorageStrategy.ts +87 -87
  71. package/src/structure/IAutoBeEventGroup.ts +6 -6
  72. package/src/structure/index.ts +4 -4
  73. package/src/types/config.ts +44 -44
  74. package/src/types/index.ts +1 -1
  75. package/src/utils/AutoBeFileUploader.ts +279 -279
  76. package/src/utils/AutoBeVoiceRecorder.ts +95 -95
  77. package/src/utils/__tests__/crypto.test.ts +286 -286
  78. package/src/utils/__tests__/storage.test.ts +229 -229
  79. package/src/utils/crypto.ts +95 -95
  80. package/src/utils/index.ts +6 -6
  81. package/src/utils/number.ts +17 -17
  82. package/src/utils/storage.ts +96 -96
  83. package/src/utils/time.ts +14 -14
  84. package/tsconfig.json +9 -9
  85. package/vitest.config.ts +15 -15
  86. package/README.md +0 -261
@@ -1,53 +1,53 @@
1
- import {
2
- AutoBeAnalyzeCompleteEvent,
3
- AutoBeDatabaseCompleteEvent,
4
- AutoBeInterfaceCompleteEvent,
5
- AutoBeRealizeCompleteEvent,
6
- AutoBeTestCompleteEvent,
7
- } from "@autobe/interface";
8
-
9
- export class AutoBeListenerState {
10
- public analyze: AutoBeAnalyzeCompleteEvent | null;
11
- public database: AutoBeDatabaseCompleteEvent | null;
12
- public interface: AutoBeInterfaceCompleteEvent | null;
13
- public test: AutoBeTestCompleteEvent | null;
14
- public realize: AutoBeRealizeCompleteEvent | null;
15
-
16
- public constructor() {
17
- this.analyze = null;
18
- this.database = null;
19
- this.interface = null;
20
- this.test = null;
21
- this.realize = null;
22
- }
23
-
24
- public setAnalyze(event: AutoBeAnalyzeCompleteEvent): void {
25
- this.analyze = event;
26
- this.database = null;
27
- this.interface = null;
28
- this.test = null;
29
- this.realize = null;
30
- }
31
-
32
- public setDatabase(event: AutoBeDatabaseCompleteEvent): void {
33
- this.database = event;
34
- this.interface = null;
35
- this.test = null;
36
- this.realize = null;
37
- }
38
-
39
- public setInterface(event: AutoBeInterfaceCompleteEvent): void {
40
- this.interface = event;
41
- this.test = null;
42
- this.realize = null;
43
- }
44
-
45
- public setTest(event: AutoBeTestCompleteEvent): void {
46
- this.test = event;
47
- this.realize = null;
48
- }
49
-
50
- public setRealize(event: AutoBeRealizeCompleteEvent): void {
51
- this.realize = event;
52
- }
53
- }
1
+ import {
2
+ AutoBeAnalyzeCompleteEvent,
3
+ AutoBeDatabaseCompleteEvent,
4
+ AutoBeInterfaceCompleteEvent,
5
+ AutoBeRealizeCompleteEvent,
6
+ AutoBeTestCompleteEvent,
7
+ } from "@autobe/interface";
8
+
9
+ export class AutoBeListenerState {
10
+ public analyze: AutoBeAnalyzeCompleteEvent | null;
11
+ public database: AutoBeDatabaseCompleteEvent | null;
12
+ public interface: AutoBeInterfaceCompleteEvent | null;
13
+ public test: AutoBeTestCompleteEvent | null;
14
+ public realize: AutoBeRealizeCompleteEvent | null;
15
+
16
+ public constructor() {
17
+ this.analyze = null;
18
+ this.database = null;
19
+ this.interface = null;
20
+ this.test = null;
21
+ this.realize = null;
22
+ }
23
+
24
+ public setAnalyze(event: AutoBeAnalyzeCompleteEvent): void {
25
+ this.analyze = event;
26
+ this.database = null;
27
+ this.interface = null;
28
+ this.test = null;
29
+ this.realize = null;
30
+ }
31
+
32
+ public setDatabase(event: AutoBeDatabaseCompleteEvent): void {
33
+ this.database = event;
34
+ this.interface = null;
35
+ this.test = null;
36
+ this.realize = null;
37
+ }
38
+
39
+ public setInterface(event: AutoBeInterfaceCompleteEvent): void {
40
+ this.interface = event;
41
+ this.test = null;
42
+ this.realize = null;
43
+ }
44
+
45
+ public setTest(event: AutoBeTestCompleteEvent): void {
46
+ this.test = event;
47
+ this.realize = null;
48
+ }
49
+
50
+ public setRealize(event: AutoBeRealizeCompleteEvent): void {
51
+ this.realize = event;
52
+ }
53
+ }
@@ -1,87 +1,87 @@
1
- import {
2
- AutoBeEvent,
3
- AutoBeHistory,
4
- IAutoBeTokenUsageJson,
5
- } from "@autobe/interface";
6
- import { IAutoBeRpcService } from "@autobe/interface";
7
-
8
- import { AutoBeListener } from "./AutoBeListener";
9
- import { IAutoBeEventGroup } from "./IAutoBeEventGroup";
10
-
11
- export interface IAutoBeAgentSession {
12
- id: string;
13
- title: string;
14
- history: AutoBeHistory[];
15
- tokenUsage: IAutoBeTokenUsageJson;
16
- createdAt: Date;
17
- updatedAt: Date;
18
- events: IAutoBeEventGroup[];
19
- }
20
-
21
- export interface IAutoBeAgentSessionStorageStrategy {
22
- appendHistory: (
23
- props: Pick<IAutoBeAgentSession, "id" | "history">,
24
- ) => Promise<void>;
25
- appendEvent: (
26
- props: Pick<IAutoBeAgentSession, "id" | "events">,
27
- ) => Promise<void>;
28
- setTokenUsage: (
29
- props: Pick<IAutoBeAgentSession, "id" | "tokenUsage">,
30
- ) => Promise<void>;
31
- getSession: (
32
- props: Pick<IAutoBeAgentSession, "id">,
33
- ) => Promise<IAutoBeAgentSession>;
34
- getSessionList: () => Promise<IAutoBeAgentSession[]>;
35
- deleteSession: (props: Pick<IAutoBeAgentSession, "id">) => Promise<void>;
36
- editSessionTitle: (
37
- props: Pick<IAutoBeAgentSession, "id" | "title">,
38
- ) => Promise<void>;
39
- }
40
-
41
- export const AutoBeAgentSession_INIT = {
42
- title: "Untitled",
43
- history: [],
44
- events: [],
45
- tokenUsage: [
46
- "aggregate",
47
- "facade",
48
- "analyze",
49
- "database",
50
- "interface",
51
- "test",
52
- "realize",
53
- ].reduce(
54
- (acc, cur) => ({
55
- ...acc,
56
- [cur]: {
57
- total: 0,
58
- input: {
59
- total: 0,
60
- cached: 0,
61
- },
62
- output: {
63
- total: 0,
64
- reasoning: 0,
65
- accepted_prediction: 0,
66
- rejected_prediction: 0,
67
- },
68
- },
69
- }),
70
- {} as IAutoBeTokenUsageJson,
71
- ),
72
- } satisfies {
73
- title: string;
74
- history: AutoBeHistory[];
75
- events: AutoBeEvent[];
76
- tokenUsage: IAutoBeTokenUsageJson;
77
- };
78
-
79
- export interface IGetAutoBeAgentSessionProps<
80
- T extends Record<string, unknown>,
81
- > {
82
- listener: AutoBeListener;
83
- connect: () => Promise<IAutoBeRpcService>;
84
- sessionId?: string;
85
- storageStrategy: IAutoBeAgentSessionStorageStrategy;
86
- additional?: T;
87
- }
1
+ import {
2
+ AutoBeEvent,
3
+ AutoBeHistory,
4
+ IAutoBeTokenUsageJson,
5
+ } from "@autobe/interface";
6
+ import { IAutoBeRpcService } from "@autobe/interface";
7
+
8
+ import { AutoBeListener } from "./AutoBeListener";
9
+ import { IAutoBeEventGroup } from "./IAutoBeEventGroup";
10
+
11
+ export interface IAutoBeAgentSession {
12
+ id: string;
13
+ title: string;
14
+ history: AutoBeHistory[];
15
+ tokenUsage: IAutoBeTokenUsageJson;
16
+ createdAt: Date;
17
+ updatedAt: Date;
18
+ events: IAutoBeEventGroup[];
19
+ }
20
+
21
+ export interface IAutoBeAgentSessionStorageStrategy {
22
+ appendHistory: (
23
+ props: Pick<IAutoBeAgentSession, "id" | "history">,
24
+ ) => Promise<void>;
25
+ appendEvent: (
26
+ props: Pick<IAutoBeAgentSession, "id" | "events">,
27
+ ) => Promise<void>;
28
+ setTokenUsage: (
29
+ props: Pick<IAutoBeAgentSession, "id" | "tokenUsage">,
30
+ ) => Promise<void>;
31
+ getSession: (
32
+ props: Pick<IAutoBeAgentSession, "id">,
33
+ ) => Promise<IAutoBeAgentSession>;
34
+ getSessionList: () => Promise<IAutoBeAgentSession[]>;
35
+ deleteSession: (props: Pick<IAutoBeAgentSession, "id">) => Promise<void>;
36
+ editSessionTitle: (
37
+ props: Pick<IAutoBeAgentSession, "id" | "title">,
38
+ ) => Promise<void>;
39
+ }
40
+
41
+ export const AutoBeAgentSession_INIT = {
42
+ title: "Untitled",
43
+ history: [],
44
+ events: [],
45
+ tokenUsage: [
46
+ "aggregate",
47
+ "facade",
48
+ "analyze",
49
+ "database",
50
+ "interface",
51
+ "test",
52
+ "realize",
53
+ ].reduce(
54
+ (acc, cur) => ({
55
+ ...acc,
56
+ [cur]: {
57
+ total: 0,
58
+ input: {
59
+ total: 0,
60
+ cached: 0,
61
+ },
62
+ output: {
63
+ total: 0,
64
+ reasoning: 0,
65
+ accepted_prediction: 0,
66
+ rejected_prediction: 0,
67
+ },
68
+ },
69
+ }),
70
+ {} as IAutoBeTokenUsageJson,
71
+ ),
72
+ } satisfies {
73
+ title: string;
74
+ history: AutoBeHistory[];
75
+ events: AutoBeEvent[];
76
+ tokenUsage: IAutoBeTokenUsageJson;
77
+ };
78
+
79
+ export interface IGetAutoBeAgentSessionProps<
80
+ T extends Record<string, unknown>,
81
+ > {
82
+ listener: AutoBeListener;
83
+ connect: () => Promise<IAutoBeRpcService>;
84
+ sessionId?: string;
85
+ storageStrategy: IAutoBeAgentSessionStorageStrategy;
86
+ additional?: T;
87
+ }
@@ -1,6 +1,6 @@
1
- import { AutoBeEvent } from "@autobe/interface";
2
-
3
- export interface IAutoBeEventGroup<Event extends AutoBeEvent = AutoBeEvent> {
4
- type: Event["type"];
5
- events: Array<Event>;
6
- }
1
+ import { AutoBeEvent } from "@autobe/interface";
2
+
3
+ export interface IAutoBeEventGroup<Event extends AutoBeEvent = AutoBeEvent> {
4
+ type: Event["type"];
5
+ events: Array<Event>;
6
+ }
@@ -1,4 +1,4 @@
1
- export * from "./AutoBeListener";
2
- export * from "./AutoBeListenerState";
3
- export * from "./IAutoBeEventGroup";
4
- export * from "./IAutoBeAgentSessionStorageStrategy";
1
+ export * from "./AutoBeListener";
2
+ export * from "./AutoBeListenerState";
3
+ export * from "./IAutoBeEventGroup";
4
+ export * from "./IAutoBeAgentSessionStorageStrategy";
@@ -1,44 +1,44 @@
1
- /**
2
- * Base configuration interface for AutoBE Contains all the standard
3
- * configuration fields with proper types
4
- */
5
- export interface IAutoBeBaseConfig {
6
- /** AI model to use (e.g., gpt-4.1, claude-3-sonnet) */
7
- aiModel: string;
8
-
9
- /** Schema model for API generation */
10
- schemaModel: string;
11
-
12
- /** Locale for internationalization */
13
- locale: string;
14
-
15
- /** OpenAI API key for authentication */
16
- openApiKey: string;
17
-
18
- /** Custom base URL for AI service (optional override) */
19
- baseUrl: string;
20
-
21
- /** Concurrency limit for requests */
22
- semaphore: number;
23
-
24
- /** Whether audio support is enabled */
25
- supportAudioEnable: boolean;
26
- }
27
-
28
- /** Extended configuration type that includes base config plus additional fields */
29
- export type IAutoBeConfig = IAutoBeBaseConfig & Record<string, unknown>;
30
-
31
- /** Partial configuration for optional fields */
32
- export type IAutoBePartialConfig = Partial<IAutoBeBaseConfig> &
33
- Record<string, unknown>;
34
-
35
- /** Default configuration values */
36
- export const DEFAULT_CONFIG: IAutoBeBaseConfig = {
37
- aiModel: "gpt-4.1",
38
- schemaModel: "chatgpt",
39
- locale: "en",
40
- openApiKey: "",
41
- baseUrl: "",
42
- semaphore: 16,
43
- supportAudioEnable: false,
44
- };
1
+ /**
2
+ * Base configuration interface for AutoBE Contains all the standard
3
+ * configuration fields with proper types
4
+ */
5
+ export interface IAutoBeBaseConfig {
6
+ /** AI model to use (e.g., gpt-4.1, claude-3-sonnet) */
7
+ aiModel: string;
8
+
9
+ /** Schema model for API generation */
10
+ schemaModel: string;
11
+
12
+ /** Locale for internationalization */
13
+ locale: string;
14
+
15
+ /** OpenAI API key for authentication */
16
+ openApiKey: string;
17
+
18
+ /** Custom base URL for AI service (optional override) */
19
+ baseUrl: string;
20
+
21
+ /** Concurrency limit for requests */
22
+ semaphore: number;
23
+
24
+ /** Whether audio support is enabled */
25
+ supportAudioEnable: boolean;
26
+ }
27
+
28
+ /** Extended configuration type that includes base config plus additional fields */
29
+ export type IAutoBeConfig = IAutoBeBaseConfig & Record<string, unknown>;
30
+
31
+ /** Partial configuration for optional fields */
32
+ export type IAutoBePartialConfig = Partial<IAutoBeBaseConfig> &
33
+ Record<string, unknown>;
34
+
35
+ /** Default configuration values */
36
+ export const DEFAULT_CONFIG: IAutoBeBaseConfig = {
37
+ aiModel: "gpt-4.1",
38
+ schemaModel: "chatgpt",
39
+ locale: "en",
40
+ openApiKey: "",
41
+ baseUrl: "",
42
+ semaphore: 16,
43
+ supportAudioEnable: false,
44
+ };
@@ -1 +1 @@
1
- export * from "./config";
1
+ export * from "./config";