@volkansuner/aichat-react-native 0.1.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.
- package/LICENSE +22 -0
- package/README.md +528 -0
- package/dist/AIChatSDK.d.ts +75 -0
- package/dist/AIChatSDK.d.ts.map +1 -0
- package/dist/AIChatSDK.js +357 -0
- package/dist/AIChatSDK.js.map +1 -0
- package/dist/components/AIChatProvider.d.ts +25 -0
- package/dist/components/AIChatProvider.d.ts.map +1 -0
- package/dist/components/AIChatProvider.js +93 -0
- package/dist/components/AIChatProvider.js.map +1 -0
- package/dist/components/AIChatWidget.d.ts +62 -0
- package/dist/components/AIChatWidget.d.ts.map +1 -0
- package/dist/components/AIChatWidget.handlers.d.ts +15 -0
- package/dist/components/AIChatWidget.handlers.d.ts.map +1 -0
- package/dist/components/AIChatWidget.handlers.js +180 -0
- package/dist/components/AIChatWidget.handlers.js.map +1 -0
- package/dist/components/AIChatWidget.js +403 -0
- package/dist/components/AIChatWidget.js.map +1 -0
- package/dist/components/AIChatWidget.styles.d.ts +17 -0
- package/dist/components/AIChatWidget.styles.d.ts.map +1 -0
- package/dist/components/AIChatWidget.styles.js +68 -0
- package/dist/components/AIChatWidget.styles.js.map +1 -0
- package/dist/components/AIChatWidget.types.d.ts +250 -0
- package/dist/components/AIChatWidget.types.d.ts.map +1 -0
- package/dist/components/AIChatWidget.types.js +3 -0
- package/dist/components/AIChatWidget.types.js.map +1 -0
- package/dist/components/AIChatWidget.utils.d.ts +12 -0
- package/dist/components/AIChatWidget.utils.d.ts.map +1 -0
- package/dist/components/AIChatWidget.utils.js +109 -0
- package/dist/components/AIChatWidget.utils.js.map +1 -0
- package/dist/components/ConfigError.d.ts +33 -0
- package/dist/components/ConfigError.d.ts.map +1 -0
- package/dist/components/ConfigError.js +195 -0
- package/dist/components/ConfigError.js.map +1 -0
- package/dist/components/FloatingButton.d.ts +12 -0
- package/dist/components/FloatingButton.d.ts.map +1 -0
- package/dist/components/FloatingButton.js +163 -0
- package/dist/components/FloatingButton.js.map +1 -0
- package/dist/components/InputArea.d.ts +58 -0
- package/dist/components/InputArea.d.ts.map +1 -0
- package/dist/components/InputArea.js +135 -0
- package/dist/components/InputArea.js.map +1 -0
- package/dist/components/MarkdownText.d.ts +16 -0
- package/dist/components/MarkdownText.d.ts.map +1 -0
- package/dist/components/MarkdownText.js +263 -0
- package/dist/components/MarkdownText.js.map +1 -0
- package/dist/components/MessageBubble.d.ts +101 -0
- package/dist/components/MessageBubble.d.ts.map +1 -0
- package/dist/components/MessageBubble.js +377 -0
- package/dist/components/MessageBubble.js.map +1 -0
- package/dist/components/NavigationSuggestion.d.ts +13 -0
- package/dist/components/NavigationSuggestion.d.ts.map +1 -0
- package/dist/components/NavigationSuggestion.js +117 -0
- package/dist/components/NavigationSuggestion.js.map +1 -0
- package/dist/components/QuickReplies.d.ts +15 -0
- package/dist/components/QuickReplies.d.ts.map +1 -0
- package/dist/components/QuickReplies.js +49 -0
- package/dist/components/QuickReplies.js.map +1 -0
- package/dist/components/TemplateRenderer.d.ts +17 -0
- package/dist/components/TemplateRenderer.d.ts.map +1 -0
- package/dist/components/TemplateRenderer.js +397 -0
- package/dist/components/TemplateRenderer.js.map +1 -0
- package/dist/components/TypingIndicator.d.ts +29 -0
- package/dist/components/TypingIndicator.d.ts.map +1 -0
- package/dist/components/TypingIndicator.js +110 -0
- package/dist/components/TypingIndicator.js.map +1 -0
- package/dist/components/defaults/DefaultCard.d.ts +15 -0
- package/dist/components/defaults/DefaultCard.d.ts.map +1 -0
- package/dist/components/defaults/DefaultCard.js +157 -0
- package/dist/components/defaults/DefaultCard.js.map +1 -0
- package/dist/components/defaults/DefaultDetail.d.ts +15 -0
- package/dist/components/defaults/DefaultDetail.d.ts.map +1 -0
- package/dist/components/defaults/DefaultDetail.js +139 -0
- package/dist/components/defaults/DefaultDetail.js.map +1 -0
- package/dist/components/defaults/DefaultList.d.ts +13 -0
- package/dist/components/defaults/DefaultList.d.ts.map +1 -0
- package/dist/components/defaults/DefaultList.js +99 -0
- package/dist/components/defaults/DefaultList.js.map +1 -0
- package/dist/components/defaults/DefaultTable.d.ts +15 -0
- package/dist/components/defaults/DefaultTable.d.ts.map +1 -0
- package/dist/components/defaults/DefaultTable.js +205 -0
- package/dist/components/defaults/DefaultTable.js.map +1 -0
- package/dist/components/defaults/index.d.ts +15 -0
- package/dist/components/defaults/index.d.ts.map +1 -0
- package/dist/components/defaults/index.js +26 -0
- package/dist/components/defaults/index.js.map +1 -0
- package/dist/components/index.d.ts +17 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +33 -0
- package/dist/components/index.js.map +1 -0
- package/dist/constants.d.ts +41 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +52 -0
- package/dist/constants.js.map +1 -0
- package/dist/hooks/useAIChatConfig.d.ts +61 -0
- package/dist/hooks/useAIChatConfig.d.ts.map +1 -0
- package/dist/hooks/useAIChatConfig.js +95 -0
- package/dist/hooks/useAIChatConfig.js.map +1 -0
- package/dist/hooks/useChatMessages.d.ts +27 -0
- package/dist/hooks/useChatMessages.d.ts.map +1 -0
- package/dist/hooks/useChatMessages.js +255 -0
- package/dist/hooks/useChatMessages.js.map +1 -0
- package/dist/hooks/useContextManager.d.ts +13 -0
- package/dist/hooks/useContextManager.d.ts.map +1 -0
- package/dist/hooks/useContextManager.js +42 -0
- package/dist/hooks/useContextManager.js.map +1 -0
- package/dist/hooks/useSDK.d.ts +18 -0
- package/dist/hooks/useSDK.d.ts.map +1 -0
- package/dist/hooks/useSDK.js +64 -0
- package/dist/hooks/useSDK.js.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +46 -0
- package/dist/index.js.map +1 -0
- package/dist/registry/TemplateRegistry.d.ts +48 -0
- package/dist/registry/TemplateRegistry.d.ts.map +1 -0
- package/dist/registry/TemplateRegistry.js +77 -0
- package/dist/registry/TemplateRegistry.js.map +1 -0
- package/dist/registry/index.d.ts +5 -0
- package/dist/registry/index.d.ts.map +1 -0
- package/dist/registry/index.js +9 -0
- package/dist/registry/index.js.map +1 -0
- package/dist/services/BackendService.d.ts +47 -0
- package/dist/services/BackendService.d.ts.map +1 -0
- package/dist/services/BackendService.js +362 -0
- package/dist/services/BackendService.js.map +1 -0
- package/dist/services/ConversationManager.d.ts +40 -0
- package/dist/services/ConversationManager.d.ts.map +1 -0
- package/dist/services/ConversationManager.js +95 -0
- package/dist/services/ConversationManager.js.map +1 -0
- package/dist/services/LocalAIClassifier.d.ts +32 -0
- package/dist/services/LocalAIClassifier.d.ts.map +1 -0
- package/dist/services/LocalAIClassifier.js +149 -0
- package/dist/services/LocalAIClassifier.js.map +1 -0
- package/dist/services/NavigationHandler.d.ts +30 -0
- package/dist/services/NavigationHandler.d.ts.map +1 -0
- package/dist/services/NavigationHandler.js +74 -0
- package/dist/services/NavigationHandler.js.map +1 -0
- package/dist/themes/dark.d.ts +6 -0
- package/dist/themes/dark.d.ts.map +1 -0
- package/dist/themes/dark.js +130 -0
- package/dist/themes/dark.js.map +1 -0
- package/dist/themes/index.d.ts +13 -0
- package/dist/themes/index.d.ts.map +1 -0
- package/dist/themes/index.js +34 -0
- package/dist/themes/index.js.map +1 -0
- package/dist/themes/light.d.ts +6 -0
- package/dist/themes/light.d.ts.map +1 -0
- package/dist/themes/light.js +130 -0
- package/dist/themes/light.js.map +1 -0
- package/dist/themes/types.d.ts +143 -0
- package/dist/themes/types.d.ts.map +1 -0
- package/dist/themes/types.js +6 -0
- package/dist/themes/types.js.map +1 -0
- package/dist/types/api.d.ts +118 -0
- package/dist/types/api.d.ts.map +1 -0
- package/dist/types/api.js +6 -0
- package/dist/types/api.js.map +1 -0
- package/dist/types/chat.d.ts +154 -0
- package/dist/types/chat.d.ts.map +1 -0
- package/dist/types/chat.js +6 -0
- package/dist/types/chat.js.map +1 -0
- package/dist/types/components.d.ts +69 -0
- package/dist/types/components.d.ts.map +1 -0
- package/dist/types/components.js +17 -0
- package/dist/types/components.js.map +1 -0
- package/dist/types/config.d.ts +122 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +18 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/document.d.ts +108 -0
- package/dist/types/document.d.ts.map +1 -0
- package/dist/types/document.js +7 -0
- package/dist/types/document.js.map +1 -0
- package/dist/types/index.d.ts +14 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +31 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/local-ai.d.ts +48 -0
- package/dist/types/local-ai.d.ts.map +1 -0
- package/dist/types/local-ai.js +17 -0
- package/dist/types/local-ai.js.map +1 -0
- package/dist/types/navigation.d.ts +89 -0
- package/dist/types/navigation.d.ts.map +1 -0
- package/dist/types/navigation.js +6 -0
- package/dist/types/navigation.js.map +1 -0
- package/dist/types/sdk.d.ts +47 -0
- package/dist/types/sdk.d.ts.map +1 -0
- package/dist/types/sdk.js +6 -0
- package/dist/types/sdk.js.map +1 -0
- package/dist/types/template.d.ts +220 -0
- package/dist/types/template.d.ts.map +1 -0
- package/dist/types/template.js +8 -0
- package/dist/types/template.js.map +1 -0
- package/dist/utils/configLoader.d.ts +69 -0
- package/dist/utils/configLoader.d.ts.map +1 -0
- package/dist/utils/configLoader.js +278 -0
- package/dist/utils/configLoader.js.map +1 -0
- package/dist/utils/deepMerge.d.ts +47 -0
- package/dist/utils/deepMerge.d.ts.map +1 -0
- package/dist/utils/deepMerge.js +71 -0
- package/dist/utils/deepMerge.js.map +1 -0
- package/package.json +65 -0
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Theme types for AIChatSDK
|
|
3
|
+
*/
|
|
4
|
+
export interface ThemeColors {
|
|
5
|
+
primary: string;
|
|
6
|
+
primaryLight: string;
|
|
7
|
+
primaryDark: string;
|
|
8
|
+
background: string;
|
|
9
|
+
surface: string;
|
|
10
|
+
overlay: string;
|
|
11
|
+
text: string;
|
|
12
|
+
textSecondary: string;
|
|
13
|
+
textLight: string;
|
|
14
|
+
textInverse: string;
|
|
15
|
+
userBubble: string;
|
|
16
|
+
userBubbleText: string;
|
|
17
|
+
aiBubble: string;
|
|
18
|
+
aiBubbleText: string;
|
|
19
|
+
border: string;
|
|
20
|
+
divider: string;
|
|
21
|
+
error: string;
|
|
22
|
+
success: string;
|
|
23
|
+
warning: string;
|
|
24
|
+
info: string;
|
|
25
|
+
inputBackground: string;
|
|
26
|
+
inputBorder: string;
|
|
27
|
+
inputPlaceholder: string;
|
|
28
|
+
buttonBackground: string;
|
|
29
|
+
buttonText: string;
|
|
30
|
+
buttonDisabled: string;
|
|
31
|
+
badge: string;
|
|
32
|
+
badgeText: string;
|
|
33
|
+
}
|
|
34
|
+
export interface ThemeSpacing {
|
|
35
|
+
xs: number;
|
|
36
|
+
sm: number;
|
|
37
|
+
md: number;
|
|
38
|
+
lg: number;
|
|
39
|
+
xl: number;
|
|
40
|
+
xxl: number;
|
|
41
|
+
}
|
|
42
|
+
export interface ThemeBorderRadius {
|
|
43
|
+
sm: number;
|
|
44
|
+
md: number;
|
|
45
|
+
lg: number;
|
|
46
|
+
xl: number;
|
|
47
|
+
full: number;
|
|
48
|
+
}
|
|
49
|
+
export interface ThemeTypography {
|
|
50
|
+
fontFamily: string;
|
|
51
|
+
fontSize: {
|
|
52
|
+
xs: number;
|
|
53
|
+
sm: number;
|
|
54
|
+
md: number;
|
|
55
|
+
lg: number;
|
|
56
|
+
xl: number;
|
|
57
|
+
xxl: number;
|
|
58
|
+
};
|
|
59
|
+
fontWeight: {
|
|
60
|
+
regular: '400';
|
|
61
|
+
medium: '500';
|
|
62
|
+
semibold: '600';
|
|
63
|
+
bold: '700';
|
|
64
|
+
};
|
|
65
|
+
lineHeight: {
|
|
66
|
+
tight: number;
|
|
67
|
+
normal: number;
|
|
68
|
+
relaxed: number;
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
export interface ThemeShadows {
|
|
72
|
+
small: {
|
|
73
|
+
shadowColor: string;
|
|
74
|
+
shadowOffset: {
|
|
75
|
+
width: number;
|
|
76
|
+
height: number;
|
|
77
|
+
};
|
|
78
|
+
shadowOpacity: number;
|
|
79
|
+
shadowRadius: number;
|
|
80
|
+
elevation: number;
|
|
81
|
+
};
|
|
82
|
+
medium: {
|
|
83
|
+
shadowColor: string;
|
|
84
|
+
shadowOffset: {
|
|
85
|
+
width: number;
|
|
86
|
+
height: number;
|
|
87
|
+
};
|
|
88
|
+
shadowOpacity: number;
|
|
89
|
+
shadowRadius: number;
|
|
90
|
+
elevation: number;
|
|
91
|
+
};
|
|
92
|
+
large: {
|
|
93
|
+
shadowColor: string;
|
|
94
|
+
shadowOffset: {
|
|
95
|
+
width: number;
|
|
96
|
+
height: number;
|
|
97
|
+
};
|
|
98
|
+
shadowOpacity: number;
|
|
99
|
+
shadowRadius: number;
|
|
100
|
+
elevation: number;
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
export interface ThemeAnimation {
|
|
104
|
+
duration: {
|
|
105
|
+
fast: number;
|
|
106
|
+
normal: number;
|
|
107
|
+
slow: number;
|
|
108
|
+
};
|
|
109
|
+
easing: {
|
|
110
|
+
easeIn: string;
|
|
111
|
+
easeOut: string;
|
|
112
|
+
easeInOut: string;
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
export interface ThemeMessages {
|
|
116
|
+
user: {
|
|
117
|
+
padding: number;
|
|
118
|
+
maxWidth: number;
|
|
119
|
+
};
|
|
120
|
+
ai: {
|
|
121
|
+
padding: number;
|
|
122
|
+
maxWidth: number;
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
export interface Theme {
|
|
126
|
+
name: 'light' | 'dark';
|
|
127
|
+
colors: ThemeColors;
|
|
128
|
+
spacing: ThemeSpacing;
|
|
129
|
+
borderRadius: ThemeBorderRadius;
|
|
130
|
+
typography: ThemeTypography;
|
|
131
|
+
shadows: ThemeShadows;
|
|
132
|
+
animation: ThemeAnimation;
|
|
133
|
+
messages?: ThemeMessages;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Partial theme type for overrides
|
|
137
|
+
* Allows specifying only the properties you want to change
|
|
138
|
+
*/
|
|
139
|
+
export type DeepPartial<T> = {
|
|
140
|
+
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
141
|
+
};
|
|
142
|
+
export type ThemeOverride = DeepPartial<Theme>;
|
|
143
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/themes/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,WAAW;IAE1B,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IAGpB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAGhB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IAGpB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IAGrB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IAGb,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IAGzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IAGvB,KAAK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1B;AAED;;;GAGG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI;KAC1B,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAChE,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/themes/types.ts"],"names":[],"mappings":";AAAA;;GAEG"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API request and response types
|
|
3
|
+
*/
|
|
4
|
+
import { NavigationSchema } from './navigation';
|
|
5
|
+
/**
|
|
6
|
+
* API error response
|
|
7
|
+
*/
|
|
8
|
+
export interface ApiError {
|
|
9
|
+
statusCode: number;
|
|
10
|
+
message: string;
|
|
11
|
+
error?: string;
|
|
12
|
+
timestamp: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Paginated response
|
|
16
|
+
*/
|
|
17
|
+
export interface PaginatedResponse<T> {
|
|
18
|
+
data: T[];
|
|
19
|
+
meta: {
|
|
20
|
+
total: number;
|
|
21
|
+
page: number;
|
|
22
|
+
limit: number;
|
|
23
|
+
totalPages: number;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Authentication types
|
|
28
|
+
*/
|
|
29
|
+
export interface LoginRequest {
|
|
30
|
+
email: string;
|
|
31
|
+
password: string;
|
|
32
|
+
}
|
|
33
|
+
export interface RegisterRequest {
|
|
34
|
+
email: string;
|
|
35
|
+
password: string;
|
|
36
|
+
name: string;
|
|
37
|
+
}
|
|
38
|
+
export interface AuthResponse {
|
|
39
|
+
token?: string;
|
|
40
|
+
accessToken?: string;
|
|
41
|
+
refreshToken?: string;
|
|
42
|
+
expiresIn?: number;
|
|
43
|
+
user: User;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* User
|
|
47
|
+
*/
|
|
48
|
+
export interface User {
|
|
49
|
+
id: string;
|
|
50
|
+
email: string;
|
|
51
|
+
name: string;
|
|
52
|
+
plan?: string;
|
|
53
|
+
tokensUsed?: number;
|
|
54
|
+
tokensLimit?: number;
|
|
55
|
+
createdAt: Date;
|
|
56
|
+
updatedAt: Date;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Project
|
|
60
|
+
*/
|
|
61
|
+
export interface Project {
|
|
62
|
+
id: string;
|
|
63
|
+
userId: string;
|
|
64
|
+
name: string;
|
|
65
|
+
description?: string;
|
|
66
|
+
apiKey: string;
|
|
67
|
+
navigationSchema?: NavigationSchema;
|
|
68
|
+
tokenUsage: number;
|
|
69
|
+
createdAt: Date;
|
|
70
|
+
updatedAt: Date;
|
|
71
|
+
}
|
|
72
|
+
export interface CreateProjectRequest {
|
|
73
|
+
name: string;
|
|
74
|
+
description?: string;
|
|
75
|
+
}
|
|
76
|
+
export interface UpdateProjectRequest {
|
|
77
|
+
name?: string;
|
|
78
|
+
description?: string;
|
|
79
|
+
}
|
|
80
|
+
export interface UploadSchemaRequest {
|
|
81
|
+
schema: NavigationSchema;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Token usage
|
|
85
|
+
*/
|
|
86
|
+
export interface TokenUsage {
|
|
87
|
+
id: string;
|
|
88
|
+
projectId: string;
|
|
89
|
+
conversationId?: string;
|
|
90
|
+
tokensUsed: number;
|
|
91
|
+
cost: number;
|
|
92
|
+
timestamp: Date;
|
|
93
|
+
metadata?: {
|
|
94
|
+
model?: string;
|
|
95
|
+
type?: 'chat' | 'embedding' | 'voice';
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Analytics
|
|
100
|
+
*/
|
|
101
|
+
export interface ProjectAnalytics {
|
|
102
|
+
projectId: string;
|
|
103
|
+
period: {
|
|
104
|
+
start: Date;
|
|
105
|
+
end: Date;
|
|
106
|
+
};
|
|
107
|
+
metrics: {
|
|
108
|
+
totalMessages: number;
|
|
109
|
+
totalTokens: number;
|
|
110
|
+
totalCost: number;
|
|
111
|
+
averageConfidence: number;
|
|
112
|
+
localHandledPercentage: number;
|
|
113
|
+
backendHandledPercentage: number;
|
|
114
|
+
};
|
|
115
|
+
conversationCount: number;
|
|
116
|
+
uniqueUsers: number;
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/types/api.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAClC,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC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AE;QACT,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,OAAO,CAAC;KACvC,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE;QACN,KAAK,EAAE,IAAI,CAAC;QACZ,GAAG,EAAE,IAAI,CAAC;KACX,CAAC;IACF,OAAO,EAAE;QACP,aAAa,EAAE,MAAM,CAAC;QACtB,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,EAAE,MAAM,CAAC;QAClB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,sBAAsB,EAAE,MAAM,CAAC;QAC/B,wBAAwB,EAAE,MAAM,CAAC;KAClC,CAAC;IACF,iBAAiB,EAAE,MAAM,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/types/api.ts"],"names":[],"mappings":";AAAA;;GAEG"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chat and messaging related types
|
|
3
|
+
*/
|
|
4
|
+
import { NavigationSuggestion } from './navigation';
|
|
5
|
+
/**
|
|
6
|
+
* Message role
|
|
7
|
+
*/
|
|
8
|
+
export type MessageRole = 'user' | 'assistant' | 'system';
|
|
9
|
+
/**
|
|
10
|
+
* Message handling location
|
|
11
|
+
*/
|
|
12
|
+
export type MessageHandler = 'local' | 'backend';
|
|
13
|
+
/**
|
|
14
|
+
* Action button types
|
|
15
|
+
*/
|
|
16
|
+
export type ActionButtonType = 'navigation' | 'api' | 'custom';
|
|
17
|
+
/**
|
|
18
|
+
* Action button for interactive messages
|
|
19
|
+
*/
|
|
20
|
+
export interface ActionButton {
|
|
21
|
+
id: string;
|
|
22
|
+
type: ActionButtonType;
|
|
23
|
+
label: string;
|
|
24
|
+
icon?: string;
|
|
25
|
+
data?: any;
|
|
26
|
+
style?: 'primary' | 'secondary' | 'success' | 'danger' | 'warning';
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Chat message
|
|
30
|
+
*/
|
|
31
|
+
export interface ChatMessage {
|
|
32
|
+
id: string;
|
|
33
|
+
role: MessageRole;
|
|
34
|
+
text: string;
|
|
35
|
+
content: string;
|
|
36
|
+
timestamp: Date;
|
|
37
|
+
isStreaming?: boolean;
|
|
38
|
+
actions?: ActionButton[];
|
|
39
|
+
metadata?: {
|
|
40
|
+
handled?: MessageHandler;
|
|
41
|
+
confidence?: number;
|
|
42
|
+
processingTime?: number;
|
|
43
|
+
tokensUsed?: number;
|
|
44
|
+
handledBy?: MessageHandler;
|
|
45
|
+
apiActionResult?: any;
|
|
46
|
+
};
|
|
47
|
+
toolResponse?: {
|
|
48
|
+
toolKey: string;
|
|
49
|
+
data: any;
|
|
50
|
+
tool: {
|
|
51
|
+
key: string;
|
|
52
|
+
name: string;
|
|
53
|
+
description: string;
|
|
54
|
+
response: {
|
|
55
|
+
type: 'list' | 'card' | 'detail' | 'table';
|
|
56
|
+
dataPath?: string;
|
|
57
|
+
itemComponent?: string;
|
|
58
|
+
maxItems?: number;
|
|
59
|
+
fallbackMessage?: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* API Action Suggestion
|
|
66
|
+
*/
|
|
67
|
+
export interface APIActionSuggestion {
|
|
68
|
+
id: string;
|
|
69
|
+
method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
70
|
+
endpoint: string;
|
|
71
|
+
description: string;
|
|
72
|
+
params?: Record<string, any>;
|
|
73
|
+
queryParams?: Record<string, any>;
|
|
74
|
+
body?: Record<string, any>;
|
|
75
|
+
headers?: Record<string, string>;
|
|
76
|
+
requiresAuth?: boolean;
|
|
77
|
+
expectedResponse?: {
|
|
78
|
+
type: string;
|
|
79
|
+
description: string;
|
|
80
|
+
example?: any;
|
|
81
|
+
};
|
|
82
|
+
risk: 'low' | 'medium' | 'high';
|
|
83
|
+
canAutoExecute: boolean;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Chat response from SDK or API
|
|
87
|
+
*/
|
|
88
|
+
export interface ChatResponse {
|
|
89
|
+
id: string;
|
|
90
|
+
text?: string;
|
|
91
|
+
message?: string;
|
|
92
|
+
timestamp: Date;
|
|
93
|
+
handledBy?: MessageHandler;
|
|
94
|
+
handled?: MessageHandler;
|
|
95
|
+
tokensUsed?: number;
|
|
96
|
+
confidence?: number;
|
|
97
|
+
navigationSuggestion?: NavigationSuggestion;
|
|
98
|
+
navigation?: NavigationSuggestion;
|
|
99
|
+
apiSuggestions?: APIActionSuggestion[];
|
|
100
|
+
metadata?: {
|
|
101
|
+
tokensUsed?: number;
|
|
102
|
+
model?: string;
|
|
103
|
+
processingTime?: number;
|
|
104
|
+
apiActionResult?: any;
|
|
105
|
+
};
|
|
106
|
+
debug?: {
|
|
107
|
+
contextUsed: Array<{
|
|
108
|
+
documentId: string;
|
|
109
|
+
documentName: string;
|
|
110
|
+
chunkIndex: number | null;
|
|
111
|
+
relevanceScore: number;
|
|
112
|
+
content: string;
|
|
113
|
+
}>;
|
|
114
|
+
searchQuery: string;
|
|
115
|
+
searchResults: number;
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Conversation context
|
|
120
|
+
*/
|
|
121
|
+
export interface ConversationContext {
|
|
122
|
+
conversationId: string;
|
|
123
|
+
projectId: string;
|
|
124
|
+
userId?: string;
|
|
125
|
+
currentRoute?: string;
|
|
126
|
+
history: ChatMessage[];
|
|
127
|
+
metadata?: Record<string, any>;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Chat request to backend
|
|
131
|
+
*/
|
|
132
|
+
export interface ChatRequest {
|
|
133
|
+
message: string;
|
|
134
|
+
sessionId: string;
|
|
135
|
+
conversationId?: string;
|
|
136
|
+
context?: {
|
|
137
|
+
currentRoute?: string;
|
|
138
|
+
previousMessages?: number;
|
|
139
|
+
metadata?: Record<string, any>;
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Conversation summary
|
|
144
|
+
*/
|
|
145
|
+
export interface ConversationSummary {
|
|
146
|
+
id: string;
|
|
147
|
+
projectId: string;
|
|
148
|
+
userId?: string;
|
|
149
|
+
messageCount: number;
|
|
150
|
+
startedAt: Date;
|
|
151
|
+
lastMessageAt: Date;
|
|
152
|
+
tokensUsed: number;
|
|
153
|
+
}
|
|
154
|
+
//# sourceMappingURL=chat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../src/types/chat.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEpD;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAC;AAE1D;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,SAAS,CAAC;AAEjD;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,YAAY,GAAG,KAAK,GAAG,QAAQ,CAAC;AAE/D;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,gBAAgB,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,KAAK,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;CACpE;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,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aAAa,EAAE,MAAM,CAAC;KACvB,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE;QACR,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KAChC,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,IAAI,CAAC;IAChB,aAAa,EAAE,IAAI,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat.js","sourceRoot":"","sources":["../../src/types/chat.ts"],"names":[],"mappings":";AAAA;;GAEG"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Component Registry types for Tool Registry
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Props passed to custom components
|
|
6
|
+
*/
|
|
7
|
+
export interface ToolComponentProps {
|
|
8
|
+
/**
|
|
9
|
+
* The data item to render (from API response)
|
|
10
|
+
*/
|
|
11
|
+
data: any;
|
|
12
|
+
/**
|
|
13
|
+
* Tool definition (includes response config)
|
|
14
|
+
*/
|
|
15
|
+
tool?: {
|
|
16
|
+
key: string;
|
|
17
|
+
description: string;
|
|
18
|
+
response: {
|
|
19
|
+
type: 'list' | 'card' | 'detail' | 'table';
|
|
20
|
+
dataPath?: string;
|
|
21
|
+
itemComponent?: string;
|
|
22
|
+
maxItems?: number;
|
|
23
|
+
fallbackMessage?: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Theme object for styling
|
|
28
|
+
*/
|
|
29
|
+
theme?: any;
|
|
30
|
+
/**
|
|
31
|
+
* Action callback for interactive elements
|
|
32
|
+
*/
|
|
33
|
+
onAction?: (actionType: string, data: any) => void;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* React Component Type (simple function component)
|
|
37
|
+
*/
|
|
38
|
+
export type ComponentType<P = any> = (props: P) => any;
|
|
39
|
+
/**
|
|
40
|
+
* Component registry - maps component names to React components
|
|
41
|
+
*/
|
|
42
|
+
export interface ComponentRegistry {
|
|
43
|
+
[componentName: string]: ComponentType<ToolComponentProps>;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Default component names
|
|
47
|
+
*/
|
|
48
|
+
export declare enum DefaultComponents {
|
|
49
|
+
Card = "DefaultCard",
|
|
50
|
+
List = "DefaultList",
|
|
51
|
+
Detail = "DefaultDetail",
|
|
52
|
+
Table = "DefaultTable"
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Tool response render type
|
|
56
|
+
*/
|
|
57
|
+
export type ToolResponseType = 'list' | 'card' | 'detail' | 'table' | 'raw';
|
|
58
|
+
/**
|
|
59
|
+
* API Action Result with rendering metadata
|
|
60
|
+
*/
|
|
61
|
+
export interface APIActionResult {
|
|
62
|
+
success: boolean;
|
|
63
|
+
data?: any;
|
|
64
|
+
error?: string;
|
|
65
|
+
renderAs?: ToolResponseType;
|
|
66
|
+
itemComponent?: string;
|
|
67
|
+
maxItems?: number;
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=components.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../src/types/components.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,IAAI,EAAE,GAAG,CAAC;IAEV;;OAEG;IACH,IAAI,CAAC,EAAE;QACL,GAAG,EAAE,MAAM,CAAC;QACZ,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE;YACR,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;YAC3C,QAAQ,CAAC,EAAE,MAAM,CAAC;YAClB,aAAa,CAAC,EAAE,MAAM,CAAC;YACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;YAClB,eAAe,CAAC,EAAE,MAAM,CAAC;SAC1B,CAAC;KACH,CAAC;IAEF;;OAEG;IACH,KAAK,CAAC,EAAE,GAAG,CAAC;IAEZ;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;CACpD;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,GAAG,CAAC;AAEvD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,CAAC,aAAa,EAAE,MAAM,GAAG,aAAa,CAAC,kBAAkB,CAAC,CAAC;CAC5D;AAED;;GAEG;AACH,oBAAY,iBAAiB;IAC3B,IAAI,gBAAgB;IACpB,IAAI,gBAAgB;IACpB,MAAM,kBAAkB;IACxB,KAAK,iBAAiB;CACvB;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,KAAK,CAAC;AAE5E;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IAGf,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Component Registry types for Tool Registry
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.DefaultComponents = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Default component names
|
|
9
|
+
*/
|
|
10
|
+
var DefaultComponents;
|
|
11
|
+
(function (DefaultComponents) {
|
|
12
|
+
DefaultComponents["Card"] = "DefaultCard";
|
|
13
|
+
DefaultComponents["List"] = "DefaultList";
|
|
14
|
+
DefaultComponents["Detail"] = "DefaultDetail";
|
|
15
|
+
DefaultComponents["Table"] = "DefaultTable";
|
|
16
|
+
})(DefaultComponents || (exports.DefaultComponents = DefaultComponents = {}));
|
|
17
|
+
//# sourceMappingURL=components.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components.js","sourceRoot":"","sources":["../../src/types/components.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAiDH;;GAEG;AACH,IAAY,iBAKX;AALD,WAAY,iBAAiB;IAC3B,yCAAoB,CAAA;IACpB,yCAAoB,CAAA;IACpB,6CAAwB,CAAA;IACxB,2CAAsB,CAAA;AACxB,CAAC,EALW,iBAAiB,iCAAjB,iBAAiB,QAK5B"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration types for AIChatSDK
|
|
3
|
+
* Supports loading from props, environment variables, or config files
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Complete AIChatSDK configuration
|
|
7
|
+
*/
|
|
8
|
+
export interface AIChatConfig {
|
|
9
|
+
/**
|
|
10
|
+
* API Key for authentication
|
|
11
|
+
* Format: aichat_[env]_pk_[timestamp]-[random]
|
|
12
|
+
* Example: aichat_test_pk_1759823924751-zw3f0ofib
|
|
13
|
+
*/
|
|
14
|
+
apiKey: string;
|
|
15
|
+
/**
|
|
16
|
+
* Backend API URL
|
|
17
|
+
* Default: http://localhost:3001/api/v1
|
|
18
|
+
*/
|
|
19
|
+
apiUrl: string;
|
|
20
|
+
/**
|
|
21
|
+
* Project ID to load project-specific theme and settings
|
|
22
|
+
* Format: MongoDB ObjectId (24-character hex string)
|
|
23
|
+
* Example: 68e4c834c62d2ff6533d6fb0
|
|
24
|
+
*/
|
|
25
|
+
projectId: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Partial config input - all fields optional
|
|
29
|
+
* Used for props, env vars, and config file
|
|
30
|
+
*/
|
|
31
|
+
export interface ConfigInput {
|
|
32
|
+
/**
|
|
33
|
+
* Optional API Key override (single key)
|
|
34
|
+
*/
|
|
35
|
+
apiKey?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Optional multi-key configuration (platform-specific)
|
|
38
|
+
* Example: { ios: 'aichat_pk_ios_xxx', android: 'aichat_pk_android_xxx' }
|
|
39
|
+
*/
|
|
40
|
+
keys?: {
|
|
41
|
+
[platform: string]: string;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Optional platform selection for multi-key setup
|
|
45
|
+
* Options: 'ios' | 'android' | 'web' | 'auto'
|
|
46
|
+
* Default: 'auto' (auto-detect from Platform.OS)
|
|
47
|
+
*/
|
|
48
|
+
platform?: 'ios' | 'android' | 'web' | 'auto' | string;
|
|
49
|
+
/**
|
|
50
|
+
* Optional API URL override
|
|
51
|
+
*/
|
|
52
|
+
apiUrl?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Optional Project ID override
|
|
55
|
+
*/
|
|
56
|
+
projectId?: string;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Config source priority for debugging and logging
|
|
60
|
+
*/
|
|
61
|
+
export declare enum ConfigSource {
|
|
62
|
+
Props = "props",
|
|
63
|
+
EnvVars = "environment-variables",
|
|
64
|
+
ConfigFile = "aichat.config.js",
|
|
65
|
+
None = "none"
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Config loading result with metadata
|
|
69
|
+
*/
|
|
70
|
+
export interface ConfigResult {
|
|
71
|
+
/**
|
|
72
|
+
* Loaded configuration (null if not found)
|
|
73
|
+
*/
|
|
74
|
+
config: AIChatConfig | null;
|
|
75
|
+
/**
|
|
76
|
+
* Sources where config values were found
|
|
77
|
+
*/
|
|
78
|
+
sources: {
|
|
79
|
+
apiKey?: ConfigSource;
|
|
80
|
+
apiUrl?: ConfigSource;
|
|
81
|
+
projectId?: ConfigSource;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Missing required config keys
|
|
85
|
+
*/
|
|
86
|
+
missing: string[];
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Config file structure (aichat.config.js)
|
|
90
|
+
*/
|
|
91
|
+
export interface AIChatConfigFile {
|
|
92
|
+
/**
|
|
93
|
+
* API Key (optional in file, can be in .env)
|
|
94
|
+
* Single key for all platforms
|
|
95
|
+
*/
|
|
96
|
+
apiKey?: string;
|
|
97
|
+
/**
|
|
98
|
+
* Multi-key configuration (platform-specific)
|
|
99
|
+
* Example: { ios: 'aichat_pk_ios_xxx', android: 'aichat_pk_android_xxx' }
|
|
100
|
+
*/
|
|
101
|
+
keys?: {
|
|
102
|
+
[platform: string]: string;
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* Platform selection for multi-key setup
|
|
106
|
+
* Options: 'ios' | 'android' | 'web' | 'auto'
|
|
107
|
+
*/
|
|
108
|
+
platform?: 'ios' | 'android' | 'web' | 'auto' | string;
|
|
109
|
+
/**
|
|
110
|
+
* Backend API URL
|
|
111
|
+
*/
|
|
112
|
+
apiUrl?: string;
|
|
113
|
+
/**
|
|
114
|
+
* Project ID
|
|
115
|
+
*/
|
|
116
|
+
projectId?: string;
|
|
117
|
+
/**
|
|
118
|
+
* Additional metadata (ignored by SDK)
|
|
119
|
+
*/
|
|
120
|
+
[key: string]: any;
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=config.d.ts.map
|