@aintela/chat 0.2.15

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 (218) hide show
  1. package/README.md +161 -0
  2. package/dist/ClientMessage-EKgfuTp8.js +40 -0
  3. package/dist/ClientMessage-EKgfuTp8.js.map +1 -0
  4. package/dist/Memory-DjLZqgbF.js +84 -0
  5. package/dist/Memory-DjLZqgbF.js.map +1 -0
  6. package/dist/Prompt-DZb7OaPp.js +37 -0
  7. package/dist/Prompt-DZb7OaPp.js.map +1 -0
  8. package/dist/artifactHtmlHandler-CMQJf1cX.js +41 -0
  9. package/dist/artifactHtmlHandler-CMQJf1cX.js.map +1 -0
  10. package/dist/auth-CcTgInbY.js +524 -0
  11. package/dist/auth-CcTgInbY.js.map +1 -0
  12. package/dist/components.d.ts +2 -0
  13. package/dist/components.js +14159 -0
  14. package/dist/components.js.map +1 -0
  15. package/dist/environmentUtils-BaKw5_VD.js +462 -0
  16. package/dist/environmentUtils-BaKw5_VD.js.map +1 -0
  17. package/dist/hooks.d.ts +2 -0
  18. package/dist/hooks.js +9 -0
  19. package/dist/hooks.js.map +1 -0
  20. package/dist/httpArtifactService-BAR60Gu1.js +1802 -0
  21. package/dist/httpArtifactService-BAR60Gu1.js.map +1 -0
  22. package/dist/httpSessionService-5Kr__oQL.js +279 -0
  23. package/dist/httpSessionService-5Kr__oQL.js.map +1 -0
  24. package/dist/index.d.ts +2 -0
  25. package/dist/index.js +226 -0
  26. package/dist/index.js.map +1 -0
  27. package/dist/interfaces.d.ts +2 -0
  28. package/dist/interfaces.js +11 -0
  29. package/dist/interfaces.js.map +1 -0
  30. package/dist/models.d.ts +2 -0
  31. package/dist/models.js +54 -0
  32. package/dist/models.js.map +1 -0
  33. package/dist/serializer-DyHZxlAG.js +1276 -0
  34. package/dist/serializer-DyHZxlAG.js.map +1 -0
  35. package/dist/services.d.ts +2 -0
  36. package/dist/services.js +16 -0
  37. package/dist/services.js.map +1 -0
  38. package/dist/sortable-table-DgQHxWIh.js +819 -0
  39. package/dist/sortable-table-DgQHxWIh.js.map +1 -0
  40. package/dist/src/ErrorBondary.d.ts +10 -0
  41. package/dist/src/components/AiChat/AiChat.d.ts +3 -0
  42. package/dist/src/components/AiChat/AiChatContext.d.ts +76 -0
  43. package/dist/src/components/AiChat/AiChatDrawer.d.ts +3 -0
  44. package/dist/src/components/AiChat/AiChatFloating.d.ts +3 -0
  45. package/dist/src/components/AiChat/AiChatProvider.d.ts +7 -0
  46. package/dist/src/components/AiChat/AiChatSessionStore.d.ts +1 -0
  47. package/dist/src/components/AiChat/AiChatTypes.d.ts +227 -0
  48. package/dist/src/components/AiChat/ChatPane/AlertDialog.d.ts +12 -0
  49. package/dist/src/components/AiChat/ChatPane/AskUserSheet.d.ts +25 -0
  50. package/dist/src/components/AiChat/ChatPane/ChatPane.d.ts +7 -0
  51. package/dist/src/components/AiChat/ChatPane/ConnectionState.d.ts +2 -0
  52. package/dist/src/components/AiChat/ChatPane/CurrentMessage.d.ts +12 -0
  53. package/dist/src/components/AiChat/ChatPane/Event.d.ts +6 -0
  54. package/dist/src/components/AiChat/ChatPane/FloatingConnectionStatus.d.ts +8 -0
  55. package/dist/src/components/AiChat/ChatPane/FriendlyPartDisplay.d.ts +13 -0
  56. package/dist/src/components/AiChat/ChatPane/LastPrompts.d.ts +9 -0
  57. package/dist/src/components/AiChat/ChatPane/Message.d.ts +11 -0
  58. package/dist/src/components/AiChat/ChatPane/MessageAgent.d.ts +16 -0
  59. package/dist/src/components/AiChat/ChatPane/MessageNonTextDisplay.d.ts +16 -0
  60. package/dist/src/components/AiChat/ChatPane/MessagePart.d.ts +15 -0
  61. package/dist/src/components/AiChat/ChatPane/MessagePersona.d.ts +13 -0
  62. package/dist/src/components/AiChat/ChatPane/MessageUser.d.ts +8 -0
  63. package/dist/src/components/AiChat/ChatPane/ModelSelector.d.ts +11 -0
  64. package/dist/src/components/AiChat/ChatPane/Prompt.d.ts +9 -0
  65. package/dist/src/components/AiChat/ChatPane/SessionDataDialog.d.ts +7 -0
  66. package/dist/src/components/AiChat/ChatPane/StickyQuestionHeader.d.ts +7 -0
  67. package/dist/src/components/AiChat/ChatPane/StreamStatistics.d.ts +32 -0
  68. package/dist/src/components/AiChat/ChatPane/SubAgentBox.d.ts +9 -0
  69. package/dist/src/components/AiChat/ChatPane/TaskList.d.ts +6 -0
  70. package/dist/src/components/AiChat/ChatPane/friendlyToolConfig.d.ts +11 -0
  71. package/dist/src/components/AiChat/ChatPane/parts/AskUserPart.d.ts +8 -0
  72. package/dist/src/components/AiChat/ChatPane/parts/BoxedPart.d.ts +4 -0
  73. package/dist/src/components/AiChat/ChatPane/parts/FunctionPart.d.ts +4 -0
  74. package/dist/src/components/AiChat/ChatPane/parts/SuspendedPart.d.ts +4 -0
  75. package/dist/src/components/AiChat/ChatPane/parts/TextPart.d.ts +4 -0
  76. package/dist/src/components/AiChat/ChatPane/parts/ThoughtPart.d.ts +4 -0
  77. package/dist/src/components/AiChat/ChatPane/parts/UiToolDispatcher.d.ts +16 -0
  78. package/dist/src/components/AiChat/ChatPane/parts/WaitingPart.d.ts +4 -0
  79. package/dist/src/components/AiChat/ChatPane/parts/index.d.ts +20 -0
  80. package/dist/src/components/AiChat/ChatPane/parts/index.test.d.ts +1 -0
  81. package/dist/src/components/AiChat/ChatPane/parts/types.d.ts +22 -0
  82. package/dist/src/components/AiChat/ChatPane/parts/uiToolRegistry.d.ts +121 -0
  83. package/dist/src/components/AiChat/index.d.ts +13 -0
  84. package/dist/src/components/AiChat/sessionStateManagerService.d.ts +47 -0
  85. package/dist/src/components/AiChat/stateConfiguration.d.ts +80 -0
  86. package/dist/src/components/Library/ArtifactRender.d.ts +18 -0
  87. package/dist/src/components/Library/DelayTextComponent.d.ts +9 -0
  88. package/dist/src/components/Library/LinearBackgroundProgress.d.ts +8 -0
  89. package/dist/src/components/Library/LinearProgressBarWithMarkers.d.ts +14 -0
  90. package/dist/src/components/Library/LoadingDots.d.ts +8 -0
  91. package/dist/src/components/Library/MarkdowmExtended.d.ts +32 -0
  92. package/dist/src/components/Library/VizLibrary/Skeletons/ChartSkeleton.d.ts +3 -0
  93. package/dist/src/components/Library/VizLibrary/Skeletons/IFrameSkeleton.d.ts +3 -0
  94. package/dist/src/components/Library/VizLibrary/Skeletons/MetricGroupSkeleton.d.ts +8 -0
  95. package/dist/src/components/Library/VizLibrary/Skeletons/MetricSkeleton.d.ts +7 -0
  96. package/dist/src/components/Library/VizLibrary/Skeletons/TableSkeleton.d.ts +7 -0
  97. package/dist/src/components/Library/VizLibrary/index.d.ts +5 -0
  98. package/dist/src/components/LlmResponseRender/EnvironmentContext.d.ts +33 -0
  99. package/dist/src/components/LlmResponseRender/GeneratingVisualization.d.ts +13 -0
  100. package/dist/src/components/LlmResponseRender/LiveJsxBlock.d.ts +55 -0
  101. package/dist/src/components/LlmResponseRender/LlmResponseRender.d.ts +29 -0
  102. package/dist/src/components/LlmResponseRender/index.d.ts +6 -0
  103. package/dist/src/components/LlmResponseRender/jsxScope.d.ts +41 -0
  104. package/dist/src/components/LlmResponseRender/liveTsxConfig.d.ts +18 -0
  105. package/dist/src/components/LlmResponseRender/parseBlocks.d.ts +39 -0
  106. package/dist/src/components/Stopwatch.d.ts +12 -0
  107. package/dist/src/components/index.d.ts +30 -0
  108. package/dist/src/components/v2/AgentActivityV2.d.ts +32 -0
  109. package/dist/src/components/v2/AiChatFloatingV2.d.ts +3 -0
  110. package/dist/src/components/v2/AiChatV2Pane.d.ts +20 -0
  111. package/dist/src/components/v2/AppBarV2.d.ts +38 -0
  112. package/dist/src/components/v2/AppRailV2.d.ts +21 -0
  113. package/dist/src/components/v2/AppShellV2.d.ts +13 -0
  114. package/dist/src/components/v2/ChatsHistoryV2.d.ts +47 -0
  115. package/dist/src/components/v2/LastPromptsV2.d.ts +6 -0
  116. package/dist/src/components/v2/MobileDrawerV2.d.ts +43 -0
  117. package/dist/src/components/v2/PromptV2.d.ts +164 -0
  118. package/dist/src/components/v2/RunProgressPanelV2.d.ts +28 -0
  119. package/dist/src/components/v2/RunProgressStripV2.d.ts +2 -0
  120. package/dist/src/components/v2/Sparkline.d.ts +10 -0
  121. package/dist/src/components/v2/SubAgentBoxV2.d.ts +15 -0
  122. package/dist/src/components/v2/TaskListV2.d.ts +8 -0
  123. package/dist/src/components/v2/icons.d.ts +42 -0
  124. package/dist/src/components/v2/index.d.ts +34 -0
  125. package/dist/src/components/v2/styles.d.ts +6 -0
  126. package/dist/src/components/v2/toolCategories.d.ts +18 -0
  127. package/dist/src/components/v2/useResponsiveLayout.d.ts +9 -0
  128. package/dist/src/hooks/index.d.ts +4 -0
  129. package/dist/src/hooks/useChatSessions.d.ts +68 -0
  130. package/dist/src/hooks/useContainerWidth.d.ts +2 -0
  131. package/dist/src/hooks/useIntervalHook.d.ts +2 -0
  132. package/dist/src/index.d.ts +7 -0
  133. package/dist/src/interfaces/IHeartbeatPort.d.ts +4 -0
  134. package/dist/src/interfaces/INotificationPort.d.ts +4 -0
  135. package/dist/src/interfaces/index.d.ts +4 -0
  136. package/dist/src/interfaces/memoryService.d.ts +37 -0
  137. package/dist/src/interfaces/schedulingService.d.ts +64 -0
  138. package/dist/src/models/Agent.d.ts +32 -0
  139. package/dist/src/models/Artifact.d.ts +21 -0
  140. package/dist/src/models/ArtifactData.d.ts +30 -0
  141. package/dist/src/models/ChatSession.d.ts +57 -0
  142. package/dist/src/models/ClientMessage.d.ts +38 -0
  143. package/dist/src/models/Customer.d.ts +7 -0
  144. package/dist/src/models/EndMessageData.d.ts +6 -0
  145. package/dist/src/models/IAbiContext.d.ts +8 -0
  146. package/dist/src/models/IDBStorable.d.ts +14 -0
  147. package/dist/src/models/Interaction.d.ts +36 -0
  148. package/dist/src/models/InteractionPart.d.ts +69 -0
  149. package/dist/src/models/LlmSession.d.ts +10 -0
  150. package/dist/src/models/Memory.d.ts +48 -0
  151. package/dist/src/models/Notification.d.ts +11 -0
  152. package/dist/src/models/Prompt.d.ts +20 -0
  153. package/dist/src/models/SendMessageResponse.d.ts +21 -0
  154. package/dist/src/models/ServerEvent.d.ts +130 -0
  155. package/dist/src/models/connectionState.d.ts +9 -0
  156. package/dist/src/models/contexts.d.ts +33 -0
  157. package/dist/src/models/enums.d.ts +333 -0
  158. package/dist/src/models/index.d.ts +36 -0
  159. package/dist/src/models/semanticKernelModel/index.d.ts +2 -0
  160. package/dist/src/models/semanticKernelModel/init.d.ts +1 -0
  161. package/dist/src/models/semanticKernelModel/models.d.ts +208 -0
  162. package/dist/src/models/semanticKernelModel/serializer.d.ts +40 -0
  163. package/dist/src/models/serverReponse.d.ts +5 -0
  164. package/dist/src/models/subAgentModel.d.ts +48 -0
  165. package/dist/src/models/todoListModel.d.ts +18 -0
  166. package/dist/src/services/WebSocketConnection/WebSocketConnectionV2.d.ts +163 -0
  167. package/dist/src/services/WebSocketConnection/webSocketConnection.d.ts +75 -0
  168. package/dist/src/services/artifactHtmlHandler.d.ts +6 -0
  169. package/dist/src/services/eventBusService.d.ts +119 -0
  170. package/dist/src/services/httpArtifactService.d.ts +25 -0
  171. package/dist/src/services/httpSessionService.d.ts +31 -0
  172. package/dist/src/services/index.d.ts +16 -0
  173. package/dist/src/services/interactionService.d.ts +28 -0
  174. package/dist/src/services/interactionService.test.d.ts +1 -0
  175. package/dist/src/services/interfaces/artifactService.d.ts +13 -0
  176. package/dist/src/services/servers/AgentGatewayService.d.ts +167 -0
  177. package/dist/src/services/servers/AgentGatewayWSAsync.d.ts +44 -0
  178. package/dist/src/services/servers/agentGatewayWSAsync.test.d.ts +1 -0
  179. package/dist/src/services/servers/sessionService/ISessionService.d.ts +20 -0
  180. package/dist/src/services/sessionEventDecoder.d.ts +22 -0
  181. package/dist/src/services/sessionEventDecoder.test.d.ts +1 -0
  182. package/dist/src/services/storageService.d.ts +73 -0
  183. package/dist/src/themes/index.d.ts +3 -0
  184. package/dist/src/themes/v2-chart-palette.d.ts +1 -0
  185. package/dist/src/themes/v2.d.ts +71 -0
  186. package/dist/src/utils/auth.d.ts +9 -0
  187. package/dist/src/utils/envOverrides.d.ts +23 -0
  188. package/dist/src/utils/envUtils.d.ts +13 -0
  189. package/dist/src/utils/environmentUtils.d.ts +43 -0
  190. package/dist/src/utils/fileUtils.d.ts +6 -0
  191. package/dist/src/utils/getAgentArtifactsBaseUrl.d.ts +1 -0
  192. package/dist/src/utils/getAgentBaseUrl.d.ts +1 -0
  193. package/dist/src/utils/getDotNetBaseUrl.d.ts +5 -0
  194. package/dist/src/utils/index.d.ts +17 -0
  195. package/dist/src/utils/interactionIdChecker.d.ts +27 -0
  196. package/dist/src/utils/jsonDetector.d.ts +50 -0
  197. package/dist/src/utils/jsonUtils.d.ts +1 -0
  198. package/dist/src/utils/materialIconsList.d.ts +42 -0
  199. package/dist/src/utils/materialIconsSvg.d.ts +51 -0
  200. package/dist/src/utils/objectUtils.d.ts +31 -0
  201. package/dist/src/utils/parseArtifact.d.ts +3 -0
  202. package/dist/src/utils/sessionWindowParameters.d.ts +3 -0
  203. package/dist/src/utils/sortable-table.d.ts +31 -0
  204. package/dist/src/utils/stringUtils.d.ts +8 -0
  205. package/dist/src/utils/uriUtils.d.ts +39 -0
  206. package/dist/src/utils/urlParser.d.ts +8 -0
  207. package/dist/style.css +94 -0
  208. package/dist/tests/fakes/fakeWebSocket.d.ts +32 -0
  209. package/dist/tests/fakes/makeGateway.d.ts +24 -0
  210. package/dist/tests/fixtures.d.ts +73 -0
  211. package/dist/useChatSessions-DttlifVk.js +107 -0
  212. package/dist/useChatSessions-DttlifVk.js.map +1 -0
  213. package/dist/useContainerWidth-Df2PmSoC.js +52 -0
  214. package/dist/useContainerWidth-Df2PmSoC.js.map +1 -0
  215. package/dist/utils.d.ts +2 -0
  216. package/dist/utils.js +49 -0
  217. package/dist/utils.js.map +1 -0
  218. package/package.json +127 -0
@@ -0,0 +1,57 @@
1
+ import { Interaction } from './Interaction';
2
+ import { AgentType, RunMode, SkillLevel } from './enums';
3
+ import { Customer } from './Customer';
4
+ import { User } from '../models/contexts';
5
+ import { IDBStorable } from './IDBStorable';
6
+ export interface SharedUser {
7
+ email: string;
8
+ permission: 'view' | 'interact';
9
+ }
10
+ export interface ChatSession extends IDBStorable {
11
+ toolSessionId?: string;
12
+ fullyLoaded: boolean;
13
+ loadError?: string;
14
+ artifacts: string[];
15
+ browserScopeId: string;
16
+ interactions: Interaction[];
17
+ userDescription?: string;
18
+ overview: string;
19
+ lastQuestion?: string | null;
20
+ agentType: AgentType;
21
+ customer?: Customer | null;
22
+ activityCount: number;
23
+ interactionsCount?: number;
24
+ allPartsCount?: number;
25
+ user: User;
26
+ lastGeneratedOverview?: Date | null;
27
+ skillLevel?: SkillLevel;
28
+ sessionRunMode: RunMode;
29
+ }
30
+ export declare class ChatSessionUtils {
31
+ static truncateText(text: string, maxLength: number): string;
32
+ static truncateSessionForStorage(chatSession: ChatSession): {
33
+ toolSessionId?: string;
34
+ fullyLoaded: boolean;
35
+ loadError?: string;
36
+ artifacts: string[];
37
+ browserScopeId: string;
38
+ interactions: Interaction[];
39
+ userDescription?: string;
40
+ overview: string;
41
+ lastQuestion?: string | null;
42
+ agentType: AgentType;
43
+ customer?: Customer | null;
44
+ activityCount: number;
45
+ interactionsCount?: number;
46
+ allPartsCount?: number;
47
+ user: User;
48
+ lastGeneratedOverview?: Date | null;
49
+ skillLevel?: SkillLevel;
50
+ sessionRunMode: RunMode;
51
+ id?: string;
52
+ created: Date;
53
+ updatedAt?: Date;
54
+ collectionName?: string;
55
+ };
56
+ static truncateInteractionsForStorage(originalInteractions: Interaction[]): Interaction[];
57
+ }
@@ -0,0 +1,38 @@
1
+ /**
2
+ * A single image attachment carried alongside a ClientMessage. `data`
3
+ * is the raw base64 payload (no `data:<mime>;base64,` prefix) so the
4
+ * server can `Convert.FromBase64String` directly into bytes.
5
+ */
6
+ export interface ClientMessageImage {
7
+ mimeType: string;
8
+ data: string;
9
+ }
10
+ export declare class ClientMessage {
11
+ mimeType: string;
12
+ data: string;
13
+ friendlyMessage?: string;
14
+ fake?: boolean;
15
+ /**
16
+ * Optional image attachments that travel as a structured payload
17
+ * on the WS frame (see `IMessage.Images`). Kept separate from
18
+ * `data` so we don't have to encode them into the text body — the
19
+ * server adds them as `ImageContent` entries on the user turn.
20
+ */
21
+ images?: ClientMessageImage[];
22
+ /**
23
+ * Optional client-only UI representation for this user turn. Carried to the
24
+ * server as a `UserUiContent` sibling (persisted + replayed) but stripped from
25
+ * every model request — `data` stays the only model-facing text. `args` is a
26
+ * serialized JSON string. The gateway also injects a matching `UserAnswer` part
27
+ * on the live interaction so the component renders immediately.
28
+ */
29
+ userUi?: {
30
+ name: string;
31
+ args?: string;
32
+ };
33
+ toPythonJson(): {
34
+ mime_type: string;
35
+ data: string;
36
+ };
37
+ constructor(data: string, mimeType: string, fake?: boolean, friendlyMessage?: string, images?: ClientMessageImage[]);
38
+ }
@@ -0,0 +1,7 @@
1
+ export interface Customer {
2
+ dataSetId: string;
3
+ name: string;
4
+ }
5
+ export interface CustomerApiResponse {
6
+ customers: Customer[];
7
+ }
@@ -0,0 +1,6 @@
1
+ import { SkillLevel } from './enums';
2
+ export interface EndMessageData {
3
+ category?: string;
4
+ summary?: string;
5
+ transferTo?: SkillLevel;
6
+ }
@@ -0,0 +1,8 @@
1
+ import { ChatSession } from './ChatSession';
2
+ import { User, AgentContext } from './contexts';
3
+ export interface IEbiContextData {
4
+ user?: User;
5
+ context: AgentContext | null;
6
+ session: ChatSession | null;
7
+ sessionId: string | null;
8
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Base interface for all database-storable entities
3
+ * Provides common properties and collection name management
4
+ */
5
+ export interface IDBStorable {
6
+ /** Unique identifier for the document */
7
+ id?: string;
8
+ /** When the document was created */
9
+ created: Date;
10
+ /** When the document was last updated */
11
+ updatedAt?: Date;
12
+ /** The Firestore collection name for this entity type */
13
+ readonly collectionName?: string;
14
+ }
@@ -0,0 +1,36 @@
1
+ import { TodoList } from './todoListModel';
2
+ import { Artifact } from './Artifact';
3
+ import { InteractionPart } from './InteractionPart';
4
+ export interface MergeResult {
5
+ updatedInteraction: Interaction;
6
+ updatedParts: InteractionPart[];
7
+ newArtifacts: Partial<Artifact>[] | null;
8
+ mainBranch: Interaction | null;
9
+ analyticsBranch: Interaction | null;
10
+ mainBranchPartsChanged: InteractionPart[] | null;
11
+ analyticsBranchPartsChanged: InteractionPart[] | null;
12
+ }
13
+ export interface TurnOpenCloseDetails {
14
+ stack: string[];
15
+ turnClosed: boolean;
16
+ }
17
+ export interface Interaction {
18
+ isSuspended?: boolean;
19
+ created: Date;
20
+ interactionId: string;
21
+ sessionId?: string;
22
+ artifactData: Artifact[];
23
+ partial: boolean;
24
+ todoList?: TodoList;
25
+ turn_complete?: boolean;
26
+ isFinalResponse?: boolean;
27
+ interactionQuestion?: string;
28
+ asyncFinalResponse?: boolean;
29
+ version: number;
30
+ parts: InteractionPart[];
31
+ turnOpenCloseStack?: TurnOpenCloseDetails;
32
+ agentServerBaseUrl?: string | null;
33
+ functionMap?: Map<string, InteractionPart>;
34
+ contextStatus?: any;
35
+ taskLists?: Map<string, string>;
36
+ }
@@ -0,0 +1,69 @@
1
+ import { FunctionDetails, CodeExecutionResultDetails, ExecutableCodeDetails, ThoughtDetails, ErrorDetails, TextDetails, ToolEventDetails } from './ServerEvent';
2
+ import { EventType } from './enums';
3
+ export interface InteractionPart {
4
+ id: string;
5
+ eventType: EventType;
6
+ author: string;
7
+ functionDetails?: FunctionDetails;
8
+ codeExecutionResultDetails?: CodeExecutionResultDetails;
9
+ executableCodeDetails?: ExecutableCodeDetails;
10
+ thoughtDetails?: ThoughtDetails;
11
+ toolDetails?: ToolEventDetails;
12
+ textDetails?: TextDetails;
13
+ errorDetails?: ErrorDetails;
14
+ visible?: boolean;
15
+ created: Date;
16
+ ended?: Date;
17
+ text?: string;
18
+ hasTask?: boolean;
19
+ rawDetails?: any;
20
+ textLastChunk?: string;
21
+ thoughtLastChunk?: string;
22
+ partial: boolean;
23
+ isStillWriting: boolean;
24
+ mustPush: boolean;
25
+ textAppendable: boolean;
26
+ waitingDetails?: {
27
+ stopPoint?: Date;
28
+ addTimer: boolean;
29
+ isTimerRunning: boolean;
30
+ status: string;
31
+ startingPoint: Date;
32
+ loadDots?: boolean;
33
+ };
34
+ }
35
+ export declare class InteractionPartUtils {
36
+ static replaceFirstTwoTabsPerLine(value?: any): string;
37
+ static jsonToString(json: any): string;
38
+ static functionDetailsToString(obj: any | undefined): string;
39
+ /**
40
+ * Reads the server-generated SlotId from a UI render tool's result. The
41
+ * result reaches the client as a plain object on the live path, but as a
42
+ * JSON string — sometimes double-encoded (a JSON string of a JSON string) —
43
+ * on the persisted / session-replay path. Unwrap up to two string layers
44
+ * before reading the field. Returns undefined when absent or unparseable.
45
+ */
46
+ static uiSlotId(part?: InteractionPart): string | undefined;
47
+ static fromError(errorMsg: string): InteractionPart;
48
+ static fromText(text: string, author?: string, id?: string): InteractionPart;
49
+ /**
50
+ * Builds the user-authored UI part for a `sendMessage(text, { ui })` turn. Mirrors the
51
+ * shape `ServerEvent` produces from a persisted `UserUiContent` on reload, so the live
52
+ * and replayed parts are identical: an `EventType.UserAnswer` carrying functionDetails
53
+ * {name, args, isUi, status:'Done'} that routes through the uiTool dispatcher/registry.
54
+ */
55
+ static fromUserUi(name: string, args?: string, id?: string): InteractionPart;
56
+ static createWaiting(addTimer: boolean | undefined, isTimerRunning: boolean | undefined, status: string, startingPoint: Date, stopPoint?: Date): InteractionPart;
57
+ static createSuspended(): InteractionPart;
58
+ static getPartTextContent(part: InteractionPart): string;
59
+ static FlatParts(parts: InteractionPart[]): InteractionPart | undefined;
60
+ static isCharArray(value: any): value is string[];
61
+ /**
62
+ * Detects objects like `{0: "a", 1: "b", 2: "c", ...}` — a string that was
63
+ * spread/indexed into an object (e.g. `{...someString}` or the server
64
+ * serializing a string as a char-indexed dict). Returns the reassembled
65
+ * string, or `null` if the value doesn't match this pattern.
66
+ */
67
+ static tryCollapseCharIndexedObject(value: any): string | null;
68
+ static isCodeExecution(part: InteractionPart): boolean;
69
+ }
@@ -0,0 +1,10 @@
1
+ import { IDBStorable } from './IDBStorable';
2
+ export interface LlmSession extends IDBStorable {
3
+ State?: Record<string, any>;
4
+ LoadedInstructions: string[];
5
+ }
6
+ export interface LlmCreateSessionResponse {
7
+ sessionId: string;
8
+ success: boolean;
9
+ errorMessage: string;
10
+ }
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Memory model - represents a semantic memory stored in MongoDB and Qdrant
3
+ * Mirrors the .NET Memory entity in Envision.SemanticKernel.Core/Memory/Memory.cs
4
+ */
5
+ /**
6
+ * Context types for memories - determines how they're filtered in semantic search
7
+ */
8
+ export declare enum MemoryContexts {
9
+ Table = 0,// Table schema information
10
+ Metric = 1,// Business metrics and KPIs
11
+ Chart = 2,// Chart/visualization descriptions
12
+ Dashboards = 3,// Dashboard information
13
+ Suggestions = 4,// Business recommendations
14
+ Memory = 5
15
+ }
16
+ /**
17
+ * Human-readable labels for each context type
18
+ */
19
+ export declare const MemoryContextLabels: Record<MemoryContexts, string>;
20
+ /**
21
+ * Full Memory entity as stored in the database
22
+ */
23
+ export interface SemanticMemory {
24
+ id: string;
25
+ memoryText: string;
26
+ relatedTags?: string;
27
+ created?: string;
28
+ updatedAt?: string;
29
+ runtimeScore?: number;
30
+ runtimeRank?: number;
31
+ }
32
+ /**
33
+ * Input model for creating/updating memories
34
+ * Does not include id, created, or runtime properties
35
+ */
36
+ export interface SemanticMemoryInput {
37
+ memoryText: string;
38
+ relatedTags?: string;
39
+ }
40
+ /**
41
+ * Options for semantic search
42
+ */
43
+ export interface SemanticMemorySearchOptions {
44
+ relatedTable?: string;
45
+ relatedContext?: MemoryContexts;
46
+ relatedTags?: string;
47
+ limit?: number;
48
+ }
@@ -0,0 +1,11 @@
1
+ export type NotificationType = 'info' | 'warning' | 'error';
2
+ export interface BasicNotification {
3
+ type: NotificationType;
4
+ message: string;
5
+ details?: string;
6
+ }
7
+ export interface EnvironmentNotification extends BasicNotification {
8
+ id: string;
9
+ creation: Date;
10
+ open?: boolean;
11
+ }
@@ -0,0 +1,20 @@
1
+ import { IDBStorable } from './IDBStorable';
2
+ export interface Prompt extends IDBStorable {
3
+ id: string;
4
+ promptText: string;
5
+ promptJson?: string;
6
+ created: Date;
7
+ updatedAt?: Date;
8
+ lastUpdated?: Date;
9
+ instructions?: ScoredInstruction[];
10
+ }
11
+ export interface ScoredInstruction {
12
+ instruction: string;
13
+ score: number;
14
+ group: number;
15
+ }
16
+ export declare class PromptUtils {
17
+ static createPrompt(promptText: string, promptJson?: string): Prompt;
18
+ static formatTimeAgo(created: string): string;
19
+ static truncateText(text: string, maxLength?: number, promptNumber?: number): string;
20
+ }
@@ -0,0 +1,21 @@
1
+ import { Interaction } from './Interaction';
2
+ export interface SendMessageResponse {
3
+ interaction: Interaction;
4
+ success: boolean;
5
+ error?: string;
6
+ firstReadPromise?: Promise<void>;
7
+ streamReaderPromise?: Promise<void>;
8
+ startStreamPromise?: Promise<StartStreamResponse> | null;
9
+ sendMessagePromise?: Promise<any>;
10
+ }
11
+ export interface StartStreamResponse {
12
+ success: boolean;
13
+ error?: string;
14
+ }
15
+ export interface ServerSendMessageResponse {
16
+ success: boolean;
17
+ status: string;
18
+ error_message?: string;
19
+ session_id: string;
20
+ call_id: string;
21
+ }
@@ -0,0 +1,130 @@
1
+ import { EventType } from './enums';
2
+ import { InteractionPart } from './InteractionPart';
3
+ import { EndMessageData } from './EndMessageData';
4
+ import { ArtifactJson } from '../utils/jsonDetector';
5
+ import { KernelContent, LlmArtifact, LlmEvent, PartType, SessionInformation, StreamingKernelContent } from './semanticKernelModel/models';
6
+ export interface FunctionDetails {
7
+ id: string;
8
+ args?: any;
9
+ text?: string;
10
+ name: string;
11
+ start?: Date;
12
+ end?: Date;
13
+ response?: any;
14
+ status: 'Composing' | 'Executing' | 'Done';
15
+ silent?: boolean;
16
+ /** True when this targets a [KernelUiFunction] render tool — classified as `uiTool`. */
17
+ isUi?: boolean;
18
+ /** Server-provided human one-liner describing the call args, for the tool-call chip. */
19
+ argsDescription?: string;
20
+ /**
21
+ * Client-only payload the tool produced via its ToolClientOutput sink, correlated to this call
22
+ * by id. A (possibly JSON) string off the wire — render data the LLM never saw. Arrives WITH the
23
+ * result on the live path (StreamingFinalFunctionResultContent.clientOutput) and is folded from
24
+ * the persisted FunctionClientOutputContent sibling on replay. Prefer this over `args` in a
25
+ * uiTool renderer; it is only present once the call has RESPONDED.
26
+ */
27
+ clientOutput?: any;
28
+ }
29
+ export interface ThoughtDetails {
30
+ text: string;
31
+ }
32
+ export interface ToolEventDetails {
33
+ eventName: string;
34
+ eventData: string;
35
+ subAgentId?: string;
36
+ /** Id of the session that generated the event (server-stamped). Lets consumers
37
+ * persist event-derived state to the right session even for stale/trailing events. */
38
+ sessionId?: string;
39
+ }
40
+ export interface TextDetails {
41
+ hasCodeBlock?: boolean;
42
+ version: number;
43
+ }
44
+ export interface ErrorDetails {
45
+ errorMessage: string;
46
+ }
47
+ export interface ExecutableCodeDetails {
48
+ code: string;
49
+ language: string;
50
+ }
51
+ export interface CodeExecutionResultDetails {
52
+ outcome: string;
53
+ output?: string;
54
+ }
55
+ interface CodeExecutionResult {
56
+ outcome: string | null;
57
+ output: string | null;
58
+ }
59
+ interface ExecutableCode {
60
+ code: string | null;
61
+ language: string | null;
62
+ }
63
+ interface PythonPart {
64
+ thought?: boolean | null;
65
+ code_execution_result?: CodeExecutionResult | null;
66
+ executable_code?: ExecutableCode | null;
67
+ function_call?: Partial<FunctionDetails> | null;
68
+ function_response?: Partial<FunctionDetails> | null;
69
+ text?: string | null;
70
+ }
71
+ export interface PythonEventMessage {
72
+ mime_type: string;
73
+ autor: string;
74
+ turn_complete?: boolean;
75
+ usage_metadata?: any;
76
+ end_message_data?: EndMessageData | null;
77
+ invocation_id?: string;
78
+ serverError?: string | null;
79
+ interrupted?: boolean | string;
80
+ is_final_response?: boolean;
81
+ session_information?: SessionInformation | null;
82
+ part_data?: PythonPart | null;
83
+ all_parts_data?: PythonPart[] | null;
84
+ interaction_id: string | null;
85
+ partial?: boolean | string;
86
+ artifact_generated?: ArtifactJson[];
87
+ async_final_response?: boolean;
88
+ }
89
+ export declare class ServerEvent {
90
+ uniqueId: string;
91
+ mimeType: string;
92
+ created: Date;
93
+ author: 'tool' | 'main' | 'system';
94
+ eventType: EventType;
95
+ allEventTypes: EventType[];
96
+ interactionId: string;
97
+ artifactsDelta: string[];
98
+ llmArtifacts?: LlmArtifact[];
99
+ partial: boolean;
100
+ turn_complete?: boolean;
101
+ isFinalResponse?: boolean;
102
+ interrupted?: boolean;
103
+ model_session_id: string;
104
+ functionDetails?: FunctionDetails;
105
+ executableCodeDetails?: ExecutableCodeDetails;
106
+ codeExecutionResultDetails?: CodeExecutionResultDetails;
107
+ thoughtDefails?: ThoughtDetails;
108
+ rawDetails?: any;
109
+ rendered?: boolean;
110
+ serverError?: string;
111
+ server_session_id?: string | null;
112
+ asyncFinalResponse?: boolean;
113
+ agentServerBaseUrl?: string;
114
+ parts: InteractionPart[];
115
+ endMessageData?: EndMessageData;
116
+ command?: string;
117
+ session_information?: SessionInformation;
118
+ subAgentId?: string;
119
+ subAgentName?: string;
120
+ visible: boolean;
121
+ constructor(interactionId: string);
122
+ static createErrorEvent(errorMessage: string, interactionId: string): ServerEvent;
123
+ static parseFlatPropertiesTypedEvent(event: LlmEvent): ServerEvent;
124
+ static getPartType(part: KernelContent | StreamingKernelContent): PartType;
125
+ static parseFromTypedEvent(event: LlmEvent): ServerEvent;
126
+ static createFromThought(interactionId: string, thinkingText: string): ServerEvent;
127
+ static createFromFunctionName(functionName: string, interactionId: string, callData?: any): ServerEvent;
128
+ static createFromText(message: string, interactionId: string, thinkingData?: string): ServerEvent;
129
+ }
130
+ export {};
@@ -0,0 +1,9 @@
1
+ export type ConnectionState = 'Disconnected' | 'Connected' | 'Idle' | 'Paused' | 'Connecting' | 'Unknown';
2
+ export declare const ConnectionState: {
3
+ readonly Disconnected: "Disconnected";
4
+ readonly Connected: "Connected";
5
+ readonly Paused: "Paused";
6
+ readonly Idle: "Idle";
7
+ readonly Connecting: "Connecting";
8
+ readonly Unknown: "Unknown";
9
+ };
@@ -0,0 +1,33 @@
1
+ import { Customer } from './Customer';
2
+ import { Agent } from './Agent';
3
+ import { IDBStorable } from './IDBStorable';
4
+ export declare class Account {
5
+ id: string;
6
+ biName: string;
7
+ constructor(id: string, biName: string);
8
+ getBiName(): string;
9
+ }
10
+ export interface User extends IDBStorable {
11
+ email: string;
12
+ family_name: string;
13
+ given_name: string;
14
+ name: string;
15
+ hd: string;
16
+ picture: string;
17
+ access_token: string;
18
+ previous_access_token?: string;
19
+ refresh_token?: string;
20
+ account?: Account;
21
+ }
22
+ export interface AuthState {
23
+ isAuthenticated: boolean;
24
+ isLoading: boolean;
25
+ login: (userData: User) => void;
26
+ logout: () => void;
27
+ errorMessage: string | null;
28
+ }
29
+ export interface AgentContext {
30
+ agentConfig: Partial<Agent>;
31
+ customer?: Customer;
32
+ model?: string;
33
+ }