@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,13 @@
1
+ import { default as React } from 'react';
2
+ import { FriendlyState } from './friendlyToolConfig';
3
+ interface FriendlyPartDisplayProps {
4
+ toolName: string;
5
+ state: FriendlyState;
6
+ args?: any;
7
+ isError?: boolean;
8
+ startTime?: Date;
9
+ endTime?: Date;
10
+ streamedBytes?: number;
11
+ }
12
+ declare const FriendlyPartDisplay: React.FC<FriendlyPartDisplayProps>;
13
+ export default FriendlyPartDisplay;
@@ -0,0 +1,9 @@
1
+ import { default as React } from 'react';
2
+ interface LastPromptsProps {
3
+ onPromptSelected: (promptText: string, promptJson?: string) => void;
4
+ forceExpanded?: number;
5
+ cancelTimeout: () => void;
6
+ children?: React.ReactNode;
7
+ }
8
+ declare const LastPrompts: React.FC<LastPromptsProps>;
9
+ export default LastPrompts;
@@ -0,0 +1,11 @@
1
+ import { default as React } from 'react';
2
+ import { Interaction } from '../../../models/Interaction';
3
+ interface MessageProps {
4
+ message: Interaction;
5
+ onLinkClicked: (link: string, content: string | null) => void;
6
+ appendWaitingPart: boolean;
7
+ messagesRef?: React.RefObject<Map<string, HTMLDivElement>>;
8
+ friendlyMode?: boolean;
9
+ }
10
+ declare const Message: React.FC<MessageProps>;
11
+ export default Message;
@@ -0,0 +1,16 @@
1
+ import { default as React } from 'react';
2
+ import { Interaction } from '../../../models/Interaction';
3
+ interface MessageAgentProps {
4
+ message: Interaction;
5
+ onGoing: boolean;
6
+ onLinkClicked: (link: string, content: string | null) => void;
7
+ appendWaitingPart: boolean;
8
+ messagesRef?: React.RefObject<Map<string, HTMLDivElement>>;
9
+ isConnectionOpen: boolean;
10
+ showSubAgents?: boolean;
11
+ preview: boolean;
12
+ container: string;
13
+ friendlyMode?: boolean;
14
+ }
15
+ declare const MessageAgent: React.FC<MessageAgentProps>;
16
+ export default MessageAgent;
@@ -0,0 +1,16 @@
1
+ import { default as React } from 'react';
2
+ import { InteractionPart } from '../../../models/InteractionPart';
3
+ interface MessageNonTextDisplayProps {
4
+ title: string;
5
+ icon: React.ReactNode;
6
+ elapsed?: number;
7
+ content?: string;
8
+ part: InteractionPart;
9
+ sessionId: string;
10
+ onLinkClicked: (link: string, content: string | null) => void;
11
+ onDrawCodeBlock: (code: string, className: string) => React.ReactNode;
12
+ isLastInlineInGroup?: boolean;
13
+ preview?: boolean;
14
+ }
15
+ declare const MessageNonTextDisplay: React.FC<MessageNonTextDisplayProps>;
16
+ export default MessageNonTextDisplay;
@@ -0,0 +1,15 @@
1
+ import { default as React } from 'react';
2
+ import { PartRendererProps } from './parts';
3
+ /**
4
+ * Dispatcher: maps a part's event type to a renderer kind and forwards
5
+ * props to that renderer. Per-kind components live in `./parts/`.
6
+ *
7
+ * The consumer override hook reads `partRenderers` off the AiChat services
8
+ * context (set via `<AiChat partRenderers={...} />`). When no override is
9
+ * provided for a given kind, the built-in `DEFAULT_PART_RENDERERS[kind]`
10
+ * renders. Used outside an AiChatProvider, the dispatcher silently falls
11
+ * back to the built-ins — `useContext` returns undefined rather than
12
+ * throwing, so this stays usable for isolated rendering / tests.
13
+ */
14
+ declare const MessagePart: React.FC<PartRendererProps>;
15
+ export default MessagePart;
@@ -0,0 +1,13 @@
1
+ import { default as React } from 'react';
2
+ import { Interaction } from '../../../models/Interaction';
3
+ interface MessagePersonaProps {
4
+ isUser: boolean;
5
+ message: Interaction;
6
+ }
7
+ /**
8
+ * Persona header row above a message — an avatar + "{NAME} · {time}". Rendered only when the host
9
+ * enables `showPersona`. The label/initials come from `resolvePersona` (default: generic
10
+ * "Você" / "Agente") and the time from `formatTimestamp(message.created)` (default: locale HH:mm).
11
+ */
12
+ declare const MessagePersona: React.FC<MessagePersonaProps>;
13
+ export default MessagePersona;
@@ -0,0 +1,8 @@
1
+ import { default as React } from 'react';
2
+ import { Interaction } from '../../../models/Interaction';
3
+ interface MessageUserProps {
4
+ message: Interaction;
5
+ onLinkClicked?: (link: string, content: string | null) => void;
6
+ }
7
+ declare const MessageUser: React.FC<MessageUserProps>;
8
+ export default MessageUser;
@@ -0,0 +1,11 @@
1
+ import { default as React } from 'react';
2
+ interface ModelSelectorProps {
3
+ /**
4
+ * Render the model list inline (no IconButton trigger, no popover)
5
+ * — used by surfaces that already host their own settings menu and
6
+ * want the model list embedded directly. Defaults to `false`.
7
+ */
8
+ inline?: boolean;
9
+ }
10
+ declare const ModelSelector: React.FC<ModelSelectorProps>;
11
+ export default ModelSelector;
@@ -0,0 +1,9 @@
1
+ import { default as React } from 'react';
2
+ interface PromptProps {
3
+ forceMessage?: string | null;
4
+ prompt?: string;
5
+ isTurnOpen?: boolean;
6
+ onHeightChange?: (newHeight: number) => void;
7
+ }
8
+ declare const Prompt: React.FC<PromptProps>;
9
+ export default Prompt;
@@ -0,0 +1,7 @@
1
+ import { default as React } from 'react';
2
+ interface SessionDataDialogProps {
3
+ open: boolean;
4
+ onClose: () => void;
5
+ }
6
+ declare const SessionDataDialog: React.FC<SessionDataDialogProps>;
7
+ export default SessionDataDialog;
@@ -0,0 +1,7 @@
1
+ import { default as React } from 'react';
2
+ interface StickyQuestionHeaderProps {
3
+ messageRefs: React.RefObject<Map<string, HTMLDivElement>>;
4
+ showStickyHeader?: boolean;
5
+ }
6
+ declare const StickyQuestionHeader: React.FC<StickyQuestionHeaderProps>;
7
+ export default StickyQuestionHeader;
@@ -0,0 +1,32 @@
1
+ import { default as React } from 'react';
2
+ /**
3
+ * Optional inline Pause / Stop control mounted at the right end of the
4
+ * stats row. When `pauseControl` is provided, StreamStatistics shows a
5
+ * single state-driven button instead of a separate footer:
6
+ *
7
+ * - turnOpen=false → disabled Pause icon
8
+ * - turnOpen=true, suspended=false → Pause icon (clickable, tooltip)
9
+ * - suspended=true → Stop icon (cancel)
10
+ *
11
+ * Hosts wire `onPause` (suspend / resume) and `onCancel` (stop stream)
12
+ * to the gateway. The component picks which one to call based on state.
13
+ */
14
+ export interface StreamStatisticsPauseControl {
15
+ turnOpen: boolean;
16
+ suspended: boolean;
17
+ suspending?: boolean;
18
+ onPause: () => void;
19
+ onCancel: () => void;
20
+ }
21
+ export interface StreamStatisticsProps {
22
+ /**
23
+ * Compact v2 chrome — mono font everywhere, hides elapsed time,
24
+ * renders a circle badge for session-size usage instead of a
25
+ * progress bar. Defaults to `false` (legacy v1 chrome).
26
+ */
27
+ compact?: boolean;
28
+ /** Optional inline Pause/Stop button. */
29
+ pauseControl?: StreamStatisticsPauseControl;
30
+ }
31
+ export declare const StreamStatistics: React.FC<StreamStatisticsProps>;
32
+ export default StreamStatistics;
@@ -0,0 +1,9 @@
1
+ import { default as React } from 'react';
2
+ import { SubAgentState } from '../stateConfiguration';
3
+ export interface SubAgentBoxProps {
4
+ subAgent: SubAgentState;
5
+ compact?: boolean;
6
+ onLinkClicked: (link: string, content: string | null) => void;
7
+ }
8
+ declare const SubAgentBox: React.FC<SubAgentBoxProps>;
9
+ export default SubAgentBox;
@@ -0,0 +1,6 @@
1
+ import { default as React } from 'react';
2
+ interface TaskListProps {
3
+ forceExpanded?: number;
4
+ }
5
+ export declare const TaskList: React.FC<TaskListProps>;
6
+ export {};
@@ -0,0 +1,11 @@
1
+ export interface FriendlyToolEntry {
2
+ partial: string;
3
+ call: string;
4
+ response: string;
5
+ responseError?: string;
6
+ extractDetail?: (args: any) => string;
7
+ }
8
+ export declare const friendlyToolConfigRegistry: Record<string, FriendlyToolEntry>;
9
+ export declare function configureFriendlyMapping(toolName: string, mapping: FriendlyToolEntry): void;
10
+ export type FriendlyState = 'partial' | 'call' | 'response';
11
+ export declare function getFriendlyLabel(toolName: string, state: FriendlyState, args?: any, isError?: boolean): string;
@@ -0,0 +1,8 @@
1
+ import { default as React } from 'react';
2
+ import { PartRendererProps } from './types';
3
+ type AskUserPartProps = Partial<PartRendererProps> & {
4
+ part: PartRendererProps['part'];
5
+ embedded?: boolean;
6
+ };
7
+ declare const AskUserPart: React.FC<AskUserPartProps>;
8
+ export default AskUserPart;
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { PartRendererProps } from './types';
3
+ declare const BoxedPart: React.FC<PartRendererProps>;
4
+ export default BoxedPart;
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { PartRendererProps } from './types';
3
+ declare const FunctionPart: React.FC<PartRendererProps>;
4
+ export default FunctionPart;
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { PartRendererProps } from './types';
3
+ declare const SuspendedPart: React.FC<PartRendererProps>;
4
+ export default SuspendedPart;
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { PartRendererProps } from './types';
3
+ declare const TextPart: React.FC<PartRendererProps>;
4
+ export default TextPart;
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { PartRendererProps } from './types';
3
+ declare const ThoughtPart: React.FC<PartRendererProps>;
4
+ export default ThoughtPart;
@@ -0,0 +1,16 @@
1
+ import { default as React } from 'react';
2
+ import { PartRendererProps } from './types';
3
+ /**
4
+ * The built-in `uiTool` renderer. The library routes every UI render tool here
5
+ * (server flags them `functionDetails.isUi`); this dispatcher then looks up the
6
+ * host's `uiTools` registry by tool name and either renders the matched
7
+ * component or fires the matched action. Unregistered tools (or no registry at
8
+ * all) fall through to `FunctionPart`, preserving the pre-registry behaviour of
9
+ * showing them like a normal tool call.
10
+ *
11
+ * Hosts may still fully override the `uiTool` kind via `partRenderers={{ uiTool }}`
12
+ * — `MessagePart` prefers an explicit override over this default — but the
13
+ * registry is the intended extension point.
14
+ */
15
+ declare const UiToolDispatcher: React.FC<PartRendererProps>;
16
+ export default UiToolDispatcher;
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { PartRendererProps } from './types';
3
+ declare const WaitingPart: React.FC<PartRendererProps>;
4
+ export default WaitingPart;
@@ -0,0 +1,20 @@
1
+ import { InteractionPart } from '../../../../models/InteractionPart';
2
+ import { PartKind, PartRenderer } from './types';
3
+ import { default as TextPart } from './TextPart';
4
+ import { default as ThoughtPart } from './ThoughtPart';
5
+ import { default as FunctionPart } from './FunctionPart';
6
+ import { default as WaitingPart } from './WaitingPart';
7
+ import { default as SuspendedPart } from './SuspendedPart';
8
+ import { default as BoxedPart } from './BoxedPart';
9
+ export declare const DEFAULT_PART_RENDERERS: Record<PartKind, PartRenderer>;
10
+ /**
11
+ * Maps an `InteractionPart` to the kind of renderer that should handle it.
12
+ * Returns `null` for parts that should not render anything (ServerError,
13
+ * unknown/filtered event types like ToolEvent which is dropped upstream
14
+ * in MessageAgent).
15
+ */
16
+ export declare function classifyPart(part: InteractionPart): PartKind | null;
17
+ export * from './types';
18
+ export * from './uiToolRegistry';
19
+ export { TextPart, ThoughtPart, FunctionPart, WaitingPart, SuspendedPart, BoxedPart };
20
+ export { default as UiToolDispatcher } from './UiToolDispatcher';
@@ -0,0 +1,22 @@
1
+ import { default as React } from 'react';
2
+ import { InteractionPart } from '../../../../models/InteractionPart';
3
+ import { Interaction } from '../../../../models/Interaction';
4
+ export type PartKind = 'text' | 'thought' | 'function' | 'waiting' | 'suspended' | 'boxed' | 'uiTool' | 'askUser';
5
+ export interface PartRendererProps {
6
+ part: InteractionPart;
7
+ message: Interaction;
8
+ onGoing: boolean;
9
+ preview: boolean;
10
+ isLastInlineInGroup?: boolean;
11
+ friendlyMode?: boolean;
12
+ onLinkClicked: (link: string, content: string | null) => void;
13
+ }
14
+ export type PartRenderer = React.ComponentType<PartRendererProps>;
15
+ export type PartRendererMap = Partial<Record<PartKind, PartRenderer>>;
16
+ /**
17
+ * Match the ask_user tool by function name across connectors. The programmed
18
+ * path emits the bare `ask_user`; live LLM connectors qualify it as
19
+ * `{Plugin}-ask_user` / `{Plugin}_ask_user` (with an empty pluginName), so a
20
+ * literal `=== 'ask_user'` misses real-model calls.
21
+ */
22
+ export declare const isAskUser: (name?: string | null) => boolean;
@@ -0,0 +1,121 @@
1
+ import { default as React } from 'react';
2
+ import { InteractionPart } from '../../../../models/InteractionPart';
3
+ import { Interaction } from '../../../../models/Interaction';
4
+ /**
5
+ * UI-tool registry — the host maps a tool NAME to either a React renderer or a
6
+ * fire-once side-effect ("action"), and the library owns everything else:
7
+ * routing the `uiTool` part kind here, parsing/unwrapping the wire args,
8
+ * normalizing the connector-qualified function name, firing actions once per
9
+ * tool-call id (and not on replay), and drawing an optional status chip.
10
+ *
11
+ * The per-entry generic (`render<TArgs>` / `action<TArgs>`) is a COMPILE-TIME
12
+ * assertion only: args arrive off the wire as `unknown` (usually a JSON string,
13
+ * sometimes double-encoded), so a missing field is `undefined` at runtime no
14
+ * matter what the type claims. Pass `opts.parse` when you want a real runtime
15
+ * guard/coercion.
16
+ *
17
+ * Build once at module load and pass the result as `<AiChatProvider uiTools={…} />`:
18
+ *
19
+ * export const uiTools = createUiToolRegistry()
20
+ * .render<{ id: string; subAgentId?: string }>('present_dashboard',
21
+ * (a) => <ScriptDashboardViewer dashboardId={a.id} … />)
22
+ * .action<{ mode?: 'create' | 'update' }>('present_dashboard_pad',
23
+ * (a, { env }) => env.updateDashboardPad?.(JSON.parse(a.definitionJson)),
24
+ * { status: 'Rascunho atualizado' })
25
+ * .build();
26
+ */
27
+ /** Default args shape when a registration omits its generic. */
28
+ export type UiToolArgs = Record<string, unknown>;
29
+ /** Context handed to every renderer. */
30
+ export interface UiToolContext {
31
+ /** Normalized tool name (`UI_` marker + `{Plugin}-`/`{Plugin}_` qualifier stripped). */
32
+ name: string;
33
+ /** This tool call's id — stable across the call's Composing→Executing→Done lifecycle. */
34
+ callId: string;
35
+ /** The tool RESULT, if any. May be an object or a (possibly double-encoded) JSON string. */
36
+ response: unknown;
37
+ /**
38
+ * The tool's CLIENT-ONLY output — the payload it wrote to its SDK `ToolClientOutput` sink,
39
+ * already parsed. This is the preferred render source: it arrives correlated to THIS call (by
40
+ * id) on the result event (so multiple UI calls never race), the LLM never saw it, and it
41
+ * survives reload. `undefined` until the call has responded, or when the tool didn't opt in
42
+ * (fall back to `args`). Replaces the old slot-id-correlated tool-event lookup over `parts`.
43
+ */
44
+ clientOutput: unknown;
45
+ /** Sibling parts of the same interaction (e.g. present_tsx's compiled-JS event rides here). */
46
+ parts: ReadonlyArray<InteractionPart>;
47
+ /** The whole interaction this part belongs to. */
48
+ message: Interaction;
49
+ /** True while the turn is still streaming. */
50
+ onGoing: boolean;
51
+ /** True during historical replay / preview — actions must NOT re-fire side effects. */
52
+ preview: boolean;
53
+ }
54
+ /** Context handed to actions — adds the host environment. */
55
+ export interface UiToolActionContext extends UiToolContext {
56
+ /**
57
+ * The host environment from `EnvironmentProvider` (e.g. `refreshDashboard`,
58
+ * `createDashboardPad`). Empty `{}` when no provider is in scope or during
59
+ * replay (`InertEnvironmentProvider` no-ops every callable) — so action calls
60
+ * simply dead-end rather than throw.
61
+ */
62
+ env: Record<string, unknown>;
63
+ }
64
+ export type UiToolRenderFn<TArgs> = (args: TArgs, ctx: UiToolContext) => React.ReactNode;
65
+ export type UiToolActionFn<TArgs> = (args: TArgs, ctx: UiToolActionContext) => void | Promise<void>;
66
+ export interface UiToolRenderOptions<TArgs> {
67
+ /** Runtime arg guard/coercion. Return `null` to render nothing (treated as invalid args). */
68
+ parse?: (raw: unknown) => TArgs | null;
69
+ }
70
+ export interface UiToolActionOptions<TArgs> {
71
+ /** Runtime arg guard/coercion. Return `null` to skip firing (treated as invalid args). */
72
+ parse?: (raw: unknown) => TArgs | null;
73
+ /**
74
+ * Optional status chip shown AFTER the action fires: a string, or a function
75
+ * of (args, ctx) returning the label (or `null` for no chip). Omit entirely
76
+ * for a silent action — no UI at all, just the side effect.
77
+ */
78
+ status?: string | ((args: TArgs, ctx: UiToolActionContext) => string | null);
79
+ }
80
+ export interface UiToolRenderEntry {
81
+ kind: 'render';
82
+ name: string;
83
+ render: UiToolRenderFn<any>;
84
+ parse?: (raw: unknown) => any;
85
+ }
86
+ export interface UiToolActionEntry {
87
+ kind: 'action';
88
+ name: string;
89
+ run: UiToolActionFn<any>;
90
+ parse?: (raw: unknown) => any;
91
+ status?: string | ((args: any, ctx: UiToolActionContext) => string | null);
92
+ }
93
+ export type UiToolEntry = UiToolRenderEntry | UiToolActionEntry;
94
+ /** A built, read-only registry passed to `<AiChatProvider uiTools={…} />`. */
95
+ export interface UiToolRegistry {
96
+ /** Resolve the entry for a RAW (possibly `UI_`-prefixed / connector-qualified) tool name. */
97
+ resolve(rawName: string | undefined | null): UiToolEntry | undefined;
98
+ /** All registered (normalized) names. */
99
+ names(): string[];
100
+ }
101
+ export interface UiToolRegistryBuilder {
102
+ render<TArgs = UiToolArgs>(name: string, render: UiToolRenderFn<TArgs>, opts?: UiToolRenderOptions<TArgs>): UiToolRegistryBuilder;
103
+ action<TArgs = UiToolArgs>(name: string, run: UiToolActionFn<TArgs>, opts?: UiToolActionOptions<TArgs>): UiToolRegistryBuilder;
104
+ build(): UiToolRegistry;
105
+ }
106
+ /**
107
+ * Tolerant unwrap for a tool's `clientOutput` payload. It reaches the client as a JSON string
108
+ * (server-serialized) on the live path and as a string off the persisted sibling on replay; peel up
109
+ * to three string layers (only when the trimmed text looks like JSON). Unlike {@link parseUiArgs}
110
+ * this does NOT require an object — a tool may hand the client an array or primitive. Returns the
111
+ * parsed value, the original non-string value as-is, or `undefined` when absent/unparseable.
112
+ */
113
+ export declare function parseClientOutput(raw: unknown): unknown;
114
+ /**
115
+ * Tolerant arg unwrap. Args reach the client as an object on the live path, but as a
116
+ * JSON string — occasionally double-encoded — on the persisted/replay path. Peel up to
117
+ * three string layers (only when the trimmed text looks like JSON), then require an
118
+ * object. Returns `null` when absent/unparseable; mirrors `InteractionPartUtils.uiSlotId`.
119
+ */
120
+ export declare function parseUiArgs(raw: unknown): UiToolArgs | null;
121
+ export declare function createUiToolRegistry(): UiToolRegistryBuilder;
@@ -0,0 +1,13 @@
1
+ export { default as AiChat } from './AiChat';
2
+ export { default as ChatPane } from './ChatPane/ChatPane';
3
+ export { AiChatProvider } from './AiChatProvider';
4
+ export { AiChatDrawer } from './AiChatDrawer';
5
+ export { AiChatFloating } from './AiChatFloating';
6
+ export type { AiChatProps, AiChatHandle, AiChatStyleProps, AiChatDrawerProps, AiChatFloatingProps, SendMessageOptions, SendMessageUi, UserMessageRendererProps } from './AiChatTypes';
7
+ export { useAiChatServices, useAiChatSessionStore } from './AiChatContext';
8
+ export { createAiChatSessionStore } from './AiChatSessionStore';
9
+ export type { SubAgentState } from './stateConfiguration';
10
+ export type { SubAgentBoxProps } from './ChatPane/SubAgentBox';
11
+ export { default as SubAgentBox } from './ChatPane/SubAgentBox';
12
+ export type { FriendlyToolEntry } from './ChatPane/friendlyToolConfig';
13
+ export { configureFriendlyMapping } from './ChatPane/friendlyToolConfig';
@@ -0,0 +1,47 @@
1
+ import { AiChatState, AiChatStore } from './stateConfiguration';
2
+ import { ChatSession } from '../../models/ChatSession';
3
+ import { SendMessageResponse } from '../../models/SendMessageResponse';
4
+ import { AgentContext } from '../../models/contexts';
5
+ import { IArtifactService } from '../../services/interfaces/artifactService';
6
+ import { AgentGatewayService } from '../../services/servers/AgentGatewayService';
7
+ import { ISessionService } from '../../services/servers/sessionService/ISessionService';
8
+ export declare const WARNING_THRESHOLD = 0.75;
9
+ export declare const BASE_MULTIPLIER = 1000;
10
+ export declare const IDLE_TIMEOUT: number;
11
+ export declare const DEFAULT_WAIT_TIME = 500;
12
+ export declare const MAX_RETRY_WAIT = 20000;
13
+ export interface SessionStateManagerOptions {
14
+ onSessionEstablished?: (sessionId: string) => void;
15
+ }
16
+ export declare class SessionStateManagerService {
17
+ private idleTime;
18
+ internalHearBeat: ReturnType<typeof setInterval> | null;
19
+ lastConCheck: number;
20
+ sessionState: AiChatState;
21
+ agentGatewayService: AgentGatewayService;
22
+ paused: boolean;
23
+ waitTimeForRetry: number;
24
+ sessionService: ISessionService;
25
+ workingContext?: AgentContext;
26
+ artifactService: IArtifactService;
27
+ workingSessionId?: string;
28
+ pendingClosePromise?: Promise<SendMessageResponse | null>;
29
+ private onSessionEstablished?;
30
+ constructor(agentGatewayService: AgentGatewayService, sessionService: ISessionService, artifactService: IArtifactService, sessionStore: AiChatStore, options?: SessionStateManagerOptions);
31
+ /**
32
+ * Update the agent context the manager will use on subsequent reconnects.
33
+ * Called by AiChatProvider when its `agentContext` prop changes — without
34
+ * this, the heartbeat-driven `processRetryLoop` would re-open with the
35
+ * stale context captured at the initial bind.
36
+ */
37
+ setAgentContext(context: AgentContext): void;
38
+ pause(): void;
39
+ start(): void;
40
+ beat(): void;
41
+ createSession(context: AgentContext, sessionId: string): Promise<ChatSession>;
42
+ retrieveSession(_context: AgentContext, sessionId: string): Promise<ChatSession | null>;
43
+ bindAndOpenLiveSession(context: AgentContext, sessionId?: string): Promise<void>;
44
+ closeLiveConnection(stoneCold?: boolean, closeTurn?: boolean): Promise<void>;
45
+ stop(): Promise<void>;
46
+ processRetryLoop(_identification?: string): void;
47
+ }
@@ -0,0 +1,80 @@
1
+ import { ChatSession } from '../../models/ChatSession';
2
+ import { Interaction } from '../../models/Interaction';
3
+ import { ConnectionState } from '../../models/connectionState';
4
+ import { StoreApi } from 'zustand';
5
+ import { SkillLevel } from '../../models/enums';
6
+ import { ToolEventDetails } from '../../models/ServerEvent';
7
+ import { InteractionStatistics } from '../../models/semanticKernelModel/models';
8
+ import { ISessionService } from '../../services/servers/sessionService/ISessionService';
9
+ export type AiChatStore = StoreApi<AiChatState>;
10
+ export declare function createAiChatStore(sessionService: ISessionService, onRenderPrompt?: (prompt: string) => {
11
+ promptAsString?: string;
12
+ json?: string;
13
+ }): AiChatStore;
14
+ export interface SubAgentState {
15
+ id: string;
16
+ name?: string;
17
+ interaction: Interaction;
18
+ completed: boolean;
19
+ }
20
+ /**
21
+ * Per-turn suspend state shared by every UI surface that exposes a
22
+ * pause/continue/stop control (PromptV2's send-button cluster,
23
+ * RunProgressPanelV2's header). v1 kept this state inside the Prompt
24
+ * component because that was the only place it surfaced; v2 ships
25
+ * the same control in two places, so a local state slice would let
26
+ * them disagree (pause in one surface didn't flip the icon in the
27
+ * other). The state machine is:
28
+ *
29
+ * idle ──pause()──> suspending ──ack──> suspended
30
+ * │
31
+ * ├── stop() ──> idle (turn killed)
32
+ * ├── continue() ──> idle (partial finalized)
33
+ * └── sendMessage ──> idle (auto-cleared by gateway)
34
+ *
35
+ * Reset to `idle` whenever the turn closes so the cluster doesn't get
36
+ * stuck on "Continuar" between turns.
37
+ */
38
+ export type SuspendState = 'idle' | 'suspending' | 'suspended';
39
+ export interface AiChatState {
40
+ session: ChatSession | null;
41
+ sendingMessage: boolean;
42
+ loading: boolean;
43
+ loadingError?: string | null;
44
+ sessionActive: boolean;
45
+ loadingType: null | 'NEW' | 'EXISTING';
46
+ skillLevel: SkillLevel;
47
+ turnOpen: boolean;
48
+ suspendState: SuspendState;
49
+ statistics?: InteractionStatistics;
50
+ connectionStatus: ConnectionState;
51
+ lastToolEvent?: ToolEventDetails;
52
+ lastActivity: number;
53
+ messages: Interaction[];
54
+ currentMessage: Interaction | null;
55
+ _turnCompleteCounter: number;
56
+ subAgents: Map<string, SubAgentState>;
57
+ setStatistics: (stats: InteractionStatistics) => void;
58
+ setIsSessionActive: (active: boolean) => void;
59
+ setLastActivity: () => void;
60
+ setLoadingInformation: (state: ConnectionState, loading: boolean, loadingType: 'EXISTING' | 'NEW' | undefined, loadingError?: string) => void;
61
+ setSendingMessage: (newValue: boolean) => void;
62
+ setLoadedInstructions: (instructions: string[]) => void;
63
+ setCurrentMessage: (message: Interaction | null) => void;
64
+ setLastToolEvent: (ToolEventDetails: ToolEventDetails | null) => void;
65
+ resetMessages: () => void;
66
+ setNewMessage: (message: Interaction) => void;
67
+ setTurnOpen: (status: boolean) => void;
68
+ setSuspendState: (status: SuspendState) => void;
69
+ setConnectionStatus: (status: ConnectionState) => void;
70
+ setSubAgentMessage: (subAgentId: string, interaction: Interaction, name?: string) => void;
71
+ completeSubAgent: (subAgentId: string) => void;
72
+ removeSubAgent: (subAgentId: string) => void;
73
+ bindingPromise: Promise<ChatSession | null> | null;
74
+ setPartialSession: (session: Partial<ChatSession | null>) => void;
75
+ setSession: (session: ChatSession | null) => void;
76
+ onRenderPrompt?: (prompt: string) => {
77
+ promptAsString?: string;
78
+ json?: any;
79
+ };
80
+ }
@@ -0,0 +1,18 @@
1
+ import { JSX } from 'react';
2
+ import { Artifact } from '../../models/Artifact';
3
+ import { IArtifactService } from '../../services/interfaces/artifactService';
4
+ interface ArtifactRenderProps {
5
+ artifact?: Artifact | null;
6
+ mode: 'full' | 'compact';
7
+ isMobile: boolean;
8
+ isTablet: boolean;
9
+ preview: boolean;
10
+ sessionId?: string;
11
+ renderMode?: 'browser' | 'serverside';
12
+ naked: boolean;
13
+ fullImage?: boolean;
14
+ artifactService: IArtifactService;
15
+ onExpand?: (artifact: Artifact) => void;
16
+ }
17
+ declare const ArtifactRender: ({ artifact, mode, sessionId, preview, onExpand, renderMode, naked, fullImage }: ArtifactRenderProps) => JSX.Element;
18
+ export default ArtifactRender;
@@ -0,0 +1,9 @@
1
+ import { default as React } from 'react';
2
+ interface DelayTextComponentProps {
3
+ text: string;
4
+ totalTime: number;
5
+ initialDelay: number;
6
+ useMarkdown?: boolean;
7
+ }
8
+ export declare const DelayTextComponent: React.FC<DelayTextComponentProps>;
9
+ export default DelayTextComponent;
@@ -0,0 +1,8 @@
1
+ export interface LinerBackgroundProgressProps {
2
+ value: number;
3
+ completedColor: string;
4
+ unCompletedColor: string;
5
+ children: React.ReactNode;
6
+ }
7
+ declare function LinerBackgroundProgress({ value, children, completedColor, unCompletedColor }: LinerBackgroundProgressProps): import("react/jsx-runtime").JSX.Element;
8
+ export default LinerBackgroundProgress;