@meistrari/chat-nuxt 2.0.0 → 3.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.
Files changed (239) hide show
  1. package/README.md +7 -9
  2. package/dist/module.d.mts +3 -2
  3. package/dist/module.json +1 -1
  4. package/dist/module.mjs +0 -39
  5. package/dist/runtime/conversations/components/chat-conversation-creator-filter.d.vue.ts +1 -1
  6. package/dist/runtime/conversations/components/chat-conversation-creator-filter.vue.d.ts +1 -1
  7. package/dist/runtime/conversations/components/chat-conversation-item.d.vue.ts +3 -3
  8. package/dist/runtime/conversations/components/chat-conversation-item.vue.d.ts +3 -3
  9. package/dist/runtime/conversations/components/chat-conversation-list.d.vue.ts +1 -1
  10. package/dist/runtime/conversations/components/chat-conversation-list.vue.d.ts +1 -1
  11. package/dist/runtime/conversations/components/chat-conversation-new-group-button.d.vue.ts +1 -1
  12. package/dist/runtime/conversations/components/chat-conversation-new-group-button.vue.d.ts +1 -1
  13. package/dist/runtime/conversations/components/chat-conversation-new-group-popover-content.d.vue.ts +4 -4
  14. package/dist/runtime/conversations/components/chat-conversation-new-group-popover-content.vue.d.ts +4 -4
  15. package/dist/runtime/conversations/components/chat-conversation-search.d.vue.ts +3 -3
  16. package/dist/runtime/conversations/components/chat-conversation-search.vue.d.ts +3 -3
  17. package/dist/runtime/conversations/components/chat-new-conversation-modal.d.vue.ts +23 -5
  18. package/dist/runtime/conversations/components/chat-new-conversation-modal.vue.d.ts +23 -5
  19. package/dist/runtime/conversations/composables/conversation-list.d.ts +58 -1
  20. package/dist/runtime/conversations/composables/conversations.d.ts +1 -4
  21. package/dist/runtime/conversations/composables/conversations.js +3 -6
  22. package/dist/runtime/embed/components/chat-configuration-modal.d.vue.ts +3 -3
  23. package/dist/runtime/embed/components/chat-configuration-modal.vue +59 -176
  24. package/dist/runtime/embed/components/chat-configuration-modal.vue.d.ts +3 -3
  25. package/dist/runtime/embed/components/chat-embed-inner.d.vue.ts +3 -3
  26. package/dist/runtime/embed/components/chat-embed-inner.vue +4 -35
  27. package/dist/runtime/embed/components/chat-embed-inner.vue.d.ts +3 -3
  28. package/dist/runtime/embed/components/chat-embed.d.vue.ts +6 -3
  29. package/dist/runtime/embed/components/chat-embed.vue +10 -2
  30. package/dist/runtime/embed/components/chat-embed.vue.d.ts +6 -3
  31. package/dist/runtime/embed/components/chat-topbar.d.vue.ts +5 -5
  32. package/dist/runtime/embed/components/chat-topbar.vue.d.ts +5 -5
  33. package/dist/runtime/embed/components/configuration/chat-configuration-agent-tab.d.vue.ts +13 -0
  34. package/dist/runtime/embed/components/configuration/chat-configuration-agent-tab.vue +167 -0
  35. package/dist/runtime/embed/components/configuration/chat-configuration-agent-tab.vue.d.ts +13 -0
  36. package/dist/runtime/embed/components/configuration/chat-configuration-credentials-tab.d.vue.ts +3 -3
  37. package/dist/runtime/embed/components/configuration/chat-configuration-credentials-tab.vue.d.ts +3 -3
  38. package/dist/runtime/embed/components/configuration/chat-configuration-knowledge-sources-tab.d.vue.ts +3 -3
  39. package/dist/runtime/embed/components/configuration/chat-configuration-knowledge-sources-tab.vue.d.ts +3 -3
  40. package/dist/runtime/embed/components/configuration/chat-configuration-mobile-shell.d.vue.ts +3 -3
  41. package/dist/runtime/embed/components/configuration/chat-configuration-mobile-shell.vue.d.ts +3 -3
  42. package/dist/runtime/embed/components/meistrari-chat-embed.vue +9 -1
  43. package/dist/runtime/embed/components/mobile/chat-mobile-bottom-sheet.d.vue.ts +3 -3
  44. package/dist/runtime/embed/components/mobile/chat-mobile-bottom-sheet.vue.d.ts +3 -3
  45. package/dist/runtime/embed/components/mobile/chat-mobile-drawer.d.vue.ts +3 -3
  46. package/dist/runtime/embed/components/mobile/chat-mobile-drawer.vue.d.ts +3 -3
  47. package/dist/runtime/embed/components/mobile/chat-mobile-file-preview.d.vue.ts +3 -3
  48. package/dist/runtime/embed/components/mobile/chat-mobile-file-preview.vue.d.ts +3 -3
  49. package/dist/runtime/embed/components/mobile/chat-mobile-files-view.d.vue.ts +3 -3
  50. package/dist/runtime/embed/components/mobile/chat-mobile-files-view.vue.d.ts +3 -3
  51. package/dist/runtime/embed/components/mobile/chat-mobile-header.d.vue.ts +5 -5
  52. package/dist/runtime/embed/components/mobile/chat-mobile-header.vue.d.ts +5 -5
  53. package/dist/runtime/embed/components/mobile/chat-mobile-home-header.d.vue.ts +3 -3
  54. package/dist/runtime/embed/components/mobile/chat-mobile-home-header.vue.d.ts +3 -3
  55. package/dist/runtime/embed/components/mobile/chat-mobile-home-recents.d.vue.ts +3 -3
  56. package/dist/runtime/embed/components/mobile/chat-mobile-home-recents.vue.d.ts +3 -3
  57. package/dist/runtime/embed/components/mobile/chat-mobile-home-suggestions.d.vue.ts +3 -3
  58. package/dist/runtime/embed/components/mobile/chat-mobile-home-suggestions.vue.d.ts +3 -3
  59. package/dist/runtime/embed/components/mobile/chat-mobile-info-bubble.d.vue.ts +1 -1
  60. package/dist/runtime/embed/components/mobile/chat-mobile-info-bubble.vue.d.ts +1 -1
  61. package/dist/runtime/embed/components/mobile/chat-mobile-outdated-settings-sheet.d.vue.ts +3 -3
  62. package/dist/runtime/embed/components/mobile/chat-mobile-outdated-settings-sheet.vue.d.ts +3 -3
  63. package/dist/runtime/embed/components/mobile/chat-mobile-shell.d.vue.ts +41 -15
  64. package/dist/runtime/embed/components/mobile/chat-mobile-shell.vue +2 -12
  65. package/dist/runtime/embed/components/mobile/chat-mobile-shell.vue.d.ts +41 -15
  66. package/dist/runtime/embed/components/mobile/chat-mobile-usage-view.d.vue.ts +1 -1
  67. package/dist/runtime/embed/components/mobile/chat-mobile-usage-view.vue.d.ts +1 -1
  68. package/dist/runtime/embed/components/mobile/chat-mobile-workspace-sheet.d.vue.ts +3 -3
  69. package/dist/runtime/embed/components/mobile/chat-mobile-workspace-sheet.vue.d.ts +3 -3
  70. package/dist/runtime/embed/components/powered-by-tela.d.vue.ts +1 -1
  71. package/dist/runtime/embed/components/powered-by-tela.vue.d.ts +1 -1
  72. package/dist/runtime/embed/composables/embed-config.d.ts +6 -0
  73. package/dist/runtime/embed/composables/embed-config.js +11 -3
  74. package/dist/runtime/embed/feature-config.d.ts +0 -2
  75. package/dist/runtime/embed/feature-config.js +0 -1
  76. package/dist/runtime/embed/types.d.ts +14 -0
  77. package/dist/runtime/files/components/audio-preview.d.vue.ts +3 -3
  78. package/dist/runtime/files/components/audio-preview.vue.d.ts +3 -3
  79. package/dist/runtime/files/components/chat-file-preview.d.vue.ts +1 -1
  80. package/dist/runtime/files/components/chat-file-preview.vue.d.ts +1 -1
  81. package/dist/runtime/files/components/chat-files-view.d.vue.ts +1 -1
  82. package/dist/runtime/files/components/chat-files-view.vue.d.ts +1 -1
  83. package/dist/runtime/files/components/chat-vault-link.d.vue.ts +1 -1
  84. package/dist/runtime/files/components/chat-vault-link.vue.d.ts +1 -1
  85. package/dist/runtime/files/components/conversation-files-panel.d.vue.ts +1 -1
  86. package/dist/runtime/files/components/conversation-files-panel.vue.d.ts +1 -1
  87. package/dist/runtime/files/components/csv-preview.d.vue.ts +3 -3
  88. package/dist/runtime/files/components/csv-preview.vue.d.ts +3 -3
  89. package/dist/runtime/files/components/file-preview-panel.d.vue.ts +1 -1
  90. package/dist/runtime/files/components/file-preview-panel.vue.d.ts +1 -1
  91. package/dist/runtime/files/components/file-uploader.d.vue.ts +3 -3
  92. package/dist/runtime/files/components/file-uploader.vue.d.ts +3 -3
  93. package/dist/runtime/files/components/image-preview.d.vue.ts +3 -3
  94. package/dist/runtime/files/components/image-preview.vue.d.ts +3 -3
  95. package/dist/runtime/files/components/pdf-preview.client.d.vue.ts +3 -3
  96. package/dist/runtime/files/components/pdf-preview.client.vue.d.ts +3 -3
  97. package/dist/runtime/files/components/pdf-viewer.client.d.vue.ts +1 -1
  98. package/dist/runtime/files/components/pdf-viewer.client.vue.d.ts +1 -1
  99. package/dist/runtime/files/components/text-preview.d.vue.ts +3 -3
  100. package/dist/runtime/files/components/text-preview.vue.d.ts +3 -3
  101. package/dist/runtime/files/components/video-preview.d.vue.ts +3 -3
  102. package/dist/runtime/files/components/video-preview.vue.d.ts +3 -3
  103. package/dist/runtime/files/composables/pdf.d.ts +248 -27
  104. package/dist/runtime/files/file-limits.d.ts +2 -0
  105. package/dist/runtime/files/file-limits.js +2 -0
  106. package/dist/runtime/messages/components/chat-canvas-selector-modal.d.vue.ts +23 -5
  107. package/dist/runtime/messages/components/chat-canvas-selector-modal.vue.d.ts +23 -5
  108. package/dist/runtime/messages/components/chat-context-config.d.vue.ts +52 -10
  109. package/dist/runtime/messages/components/chat-context-config.vue +2 -2
  110. package/dist/runtime/messages/components/chat-context-config.vue.d.ts +52 -10
  111. package/dist/runtime/messages/components/chat-mention-dropdown.d.vue.ts +27 -5
  112. package/dist/runtime/messages/components/chat-mention-dropdown.vue.d.ts +27 -5
  113. package/dist/runtime/messages/components/chat-message-bubble.d.vue.ts +3 -3
  114. package/dist/runtime/messages/components/chat-message-bubble.vue +8 -4
  115. package/dist/runtime/messages/components/chat-message-bubble.vue.d.ts +3 -3
  116. package/dist/runtime/messages/components/chat-message-feedback.d.vue.ts +7 -0
  117. package/dist/runtime/messages/components/chat-message-feedback.vue +251 -0
  118. package/dist/runtime/messages/components/chat-message-feedback.vue.d.ts +7 -0
  119. package/dist/runtime/messages/components/chat-message-input.d.vue.ts +38 -16
  120. package/dist/runtime/messages/components/chat-message-input.vue +1 -8
  121. package/dist/runtime/messages/components/chat-message-input.vue.d.ts +38 -16
  122. package/dist/runtime/messages/components/chat-message-list.d.vue.ts +3 -3
  123. package/dist/runtime/messages/components/chat-message-list.vue.d.ts +3 -3
  124. package/dist/runtime/messages/components/chat-workstation-selector-modal.d.vue.ts +19 -5
  125. package/dist/runtime/messages/components/chat-workstation-selector-modal.vue.d.ts +19 -5
  126. package/dist/runtime/messages/components/reasoning/chat-reasoning-message.d.vue.ts +1 -1
  127. package/dist/runtime/messages/components/reasoning/chat-reasoning-message.vue.d.ts +1 -1
  128. package/dist/runtime/messages/components/reasoning/chat-reasoning-step-item.d.vue.ts +4 -4
  129. package/dist/runtime/messages/components/reasoning/chat-reasoning-step-item.vue.d.ts +4 -4
  130. package/dist/runtime/messages/components/reasoning/chat-reasoning-steps.d.vue.ts +2 -2
  131. package/dist/runtime/messages/components/reasoning/chat-reasoning-steps.vue.d.ts +2 -2
  132. package/dist/runtime/messages/components/reasoning/chat-reasoning-thought.d.vue.ts +1 -1
  133. package/dist/runtime/messages/components/reasoning/chat-reasoning-thought.vue.d.ts +1 -1
  134. package/dist/runtime/messages/components/reasoning/chat-thinking-indicator.d.vue.ts +1 -1
  135. package/dist/runtime/messages/components/reasoning/chat-thinking-indicator.vue.d.ts +1 -1
  136. package/dist/runtime/messages/components/widgets/chat-bash-widget.d.vue.ts +1 -1
  137. package/dist/runtime/messages/components/widgets/chat-bash-widget.vue.d.ts +1 -1
  138. package/dist/runtime/messages/components/widgets/chat-doc-sdk-widget.d.vue.ts +1 -1
  139. package/dist/runtime/messages/components/widgets/chat-doc-sdk-widget.vue.d.ts +1 -1
  140. package/dist/runtime/messages/components/widgets/chat-generic-tool-widget.d.vue.ts +1 -1
  141. package/dist/runtime/messages/components/widgets/chat-generic-tool-widget.vue.d.ts +1 -1
  142. package/dist/runtime/messages/components/widgets/chat-grep-widget.d.vue.ts +1 -1
  143. package/dist/runtime/messages/components/widgets/chat-grep-widget.vue.d.ts +1 -1
  144. package/dist/runtime/messages/components/widgets/chat-read-widget.d.vue.ts +1 -1
  145. package/dist/runtime/messages/components/widgets/chat-read-widget.vue.d.ts +1 -1
  146. package/dist/runtime/messages/components/widgets/chat-tela-skill-widget.d.vue.ts +1 -1
  147. package/dist/runtime/messages/components/widgets/chat-tela-skill-widget.vue.d.ts +1 -1
  148. package/dist/runtime/messages/components/widgets/chat-thinking-widget.d.vue.ts +1 -1
  149. package/dist/runtime/messages/components/widgets/chat-thinking-widget.vue.d.ts +1 -1
  150. package/dist/runtime/messages/components/widgets/chat-web-search-widget.d.vue.ts +1 -1
  151. package/dist/runtime/messages/components/widgets/chat-web-search-widget.vue.d.ts +1 -1
  152. package/dist/runtime/messages/components/widgets/chat-workstation-query-widget.d.vue.ts +1 -1
  153. package/dist/runtime/messages/components/widgets/chat-workstation-query-widget.vue.d.ts +1 -1
  154. package/dist/runtime/messages/components/widgets/chat-write-widget.d.vue.ts +1 -1
  155. package/dist/runtime/messages/components/widgets/chat-write-widget.vue.d.ts +1 -1
  156. package/dist/runtime/messages/composables/chat-feedback.d.ts +21 -0
  157. package/dist/runtime/messages/composables/chat-feedback.js +12 -0
  158. package/dist/runtime/messages/composables/chat.d.ts +1 -1
  159. package/dist/runtime/messages/composables/chat.js +37 -14
  160. package/dist/runtime/messages/message-state.d.ts +3 -0
  161. package/dist/runtime/messages/message-state.js +13 -0
  162. package/dist/runtime/rendering/components/app-markdown-render.d.vue.ts +2 -2
  163. package/dist/runtime/rendering/components/app-markdown-render.vue.d.ts +2 -2
  164. package/dist/runtime/rendering/components/renderers/artifact-display.d.vue.ts +3 -3
  165. package/dist/runtime/rendering/components/renderers/artifact-display.vue.d.ts +3 -3
  166. package/dist/runtime/rendering/components/renderers/audio-renderer.d.vue.ts +1 -1
  167. package/dist/runtime/rendering/components/renderers/audio-renderer.vue.d.ts +1 -1
  168. package/dist/runtime/rendering/components/renderers/csv-renderer.d.vue.ts +1 -1
  169. package/dist/runtime/rendering/components/renderers/csv-renderer.vue.d.ts +1 -1
  170. package/dist/runtime/rendering/components/renderers/image-renderer.d.vue.ts +1 -1
  171. package/dist/runtime/rendering/components/renderers/image-renderer.vue.d.ts +1 -1
  172. package/dist/runtime/rendering/components/renderers/markdown-renderer.d.vue.ts +1 -1
  173. package/dist/runtime/rendering/components/renderers/markdown-renderer.vue.d.ts +1 -1
  174. package/dist/runtime/rendering/components/renderers/mermaid-diagram.d.vue.ts +1 -1
  175. package/dist/runtime/rendering/components/renderers/mermaid-diagram.vue.d.ts +1 -1
  176. package/dist/runtime/rendering/components/renderers/text-renderer.d.vue.ts +1 -1
  177. package/dist/runtime/rendering/components/renderers/text-renderer.vue.d.ts +1 -1
  178. package/dist/runtime/rendering/components/renderers/video-renderer.d.vue.ts +1 -1
  179. package/dist/runtime/rendering/components/renderers/video-renderer.vue.d.ts +1 -1
  180. package/dist/runtime/shared/chat-api-error.d.ts +1 -0
  181. package/dist/runtime/shared/chat-api-error.js +5 -0
  182. package/dist/runtime/shared/components/app-status-toast.d.vue.ts +1 -1
  183. package/dist/runtime/shared/components/app-status-toast.vue.d.ts +1 -1
  184. package/dist/runtime/shared/components/icons/anthropic.d.vue.ts +1 -1
  185. package/dist/runtime/shared/components/icons/anthropic.vue.d.ts +1 -1
  186. package/dist/runtime/shared/components/icons/tela-chat.d.vue.ts +1 -1
  187. package/dist/runtime/shared/components/icons/tela-chat.vue.d.ts +1 -1
  188. package/dist/runtime/shared/components/icons/tela-wordmark.d.vue.ts +1 -1
  189. package/dist/runtime/shared/components/icons/tela-wordmark.vue.d.ts +1 -1
  190. package/dist/runtime/types/embed.d.ts +1 -0
  191. package/dist/runtime/types/schemas/chat/conversations.d.ts +2 -3
  192. package/dist/runtime/types/schemas/chat/conversations.js +2 -3
  193. package/dist/runtime/types/schemas/chat/messages.d.ts +6 -48
  194. package/dist/runtime/types/schemas/chat/messages.js +5 -4
  195. package/dist/runtime/types/schemas/chat/workspace-agent.d.ts +33 -0
  196. package/dist/runtime/types/schemas/chat/workspace-agent.js +12 -0
  197. package/dist/runtime/types/schemas/chat/workspace-settings.d.ts +0 -47
  198. package/dist/runtime/types/schemas/chat/workspace-settings.js +0 -1
  199. package/dist/runtime/types/schemas/index.d.ts +1 -0
  200. package/dist/runtime/types/schemas/index.js +1 -0
  201. package/dist/runtime/types/schemas/integrations/tela-agent-api.d.ts +34 -0
  202. package/dist/runtime/types/schemas/integrations/tela-agent-api.js +3 -0
  203. package/dist/runtime/types/workspace-settings.d.ts +1 -1
  204. package/dist/runtime/usage/components/chat-usage-view.d.vue.ts +1 -1
  205. package/dist/runtime/usage/components/chat-usage-view.vue.d.ts +1 -1
  206. package/dist/runtime/workspace/composables/github-skills-callback.js +1 -1
  207. package/dist/runtime/workspace/composables/workspace-agent.d.ts +8 -0
  208. package/dist/runtime/workspace/composables/workspace-agent.js +89 -0
  209. package/dist/runtime/workspace/composables/workspace-settings.d.ts +42 -1
  210. package/dist/types.d.mts +1 -1
  211. package/package.json +15 -15
  212. package/dist/runtime/embed/components/configuration/chat-configuration-context-files-tab.d.vue.ts +0 -22
  213. package/dist/runtime/embed/components/configuration/chat-configuration-context-files-tab.vue +0 -133
  214. package/dist/runtime/embed/components/configuration/chat-configuration-context-files-tab.vue.d.ts +0 -22
  215. package/dist/runtime/embed/components/configuration/chat-configuration-external-skills-tab.d.vue.ts +0 -32
  216. package/dist/runtime/embed/components/configuration/chat-configuration-external-skills-tab.vue +0 -222
  217. package/dist/runtime/embed/components/configuration/chat-configuration-external-skills-tab.vue.d.ts +0 -32
  218. package/dist/runtime/embed/components/configuration/chat-configuration-personalization-tab.d.vue.ts +0 -10
  219. package/dist/runtime/embed/components/configuration/chat-configuration-personalization-tab.vue +0 -37
  220. package/dist/runtime/embed/components/configuration/chat-configuration-personalization-tab.vue.d.ts +0 -10
  221. package/dist/runtime/embed/components/configuration/chat-configuration-tela-tools-tab.d.vue.ts +0 -20
  222. package/dist/runtime/embed/components/configuration/chat-configuration-tela-tools-tab.vue +0 -146
  223. package/dist/runtime/embed/components/configuration/chat-configuration-tela-tools-tab.vue.d.ts +0 -20
  224. package/dist/runtime/internal/agent-environment-resolver.stub.d.ts +0 -2
  225. package/dist/runtime/internal/agent-environment-resolver.stub.js +0 -1
  226. package/dist/runtime/messages/components/chat-model-selector.d.vue.ts +0 -15
  227. package/dist/runtime/messages/components/chat-model-selector.vue +0 -42
  228. package/dist/runtime/messages/components/chat-model-selector.vue.d.ts +0 -15
  229. package/dist/runtime/messages/composables/selected-model.d.ts +0 -4
  230. package/dist/runtime/messages/composables/selected-model.js +0 -48
  231. package/dist/runtime/types/chat-agent-environment-resolver.d.ts +0 -4
  232. package/dist/runtime/workspace/composables/workspace-context-files.d.ts +0 -19
  233. package/dist/runtime/workspace/composables/workspace-context-files.js +0 -83
  234. package/dist/runtime/workspace/composables/workspace-external-skills.d.ts +0 -22
  235. package/dist/runtime/workspace/composables/workspace-external-skills.js +0 -137
  236. package/dist/runtime/workspace/composables/workspace-personalization.d.ts +0 -6
  237. package/dist/runtime/workspace/composables/workspace-personalization.js +0 -18
  238. package/dist/runtime/workspace/composables/workspace-tela-tools.d.ts +0 -13
  239. package/dist/runtime/workspace/composables/workspace-tela-tools.js +0 -91
@@ -6,17 +6,21 @@ import {
6
6
  } from "../message-reasoning.js";
7
7
  import {
8
8
  beginAssistantMessageRetry,
9
+ markPendingAssistantMessagesFailed,
9
10
  markPendingAssistantMessagesInterrupted,
10
11
  restoreAssistantMessageAfterRetryFailure,
11
12
  selectTitleGenerationMessages,
12
- shouldTreatLoadedConversationTitleAsGenerated
13
+ shouldTreatLoadedConversationTitleAsGenerated,
14
+ CANCELLATION_FAILED_TEXT
13
15
  } from "../message-state.js";
14
16
  import { exportConversationToMarkdown } from "../../conversations/export.js";
15
17
  import { resolveChatStateScope } from "../../conversations/scope.js";
18
+ import { getChatApiErrorCode, getChatApiErrorMessage } from "../../shared/chat-api-error.js";
16
19
  import { useChatApi } from "../../shared/composables/chat-api.js";
17
20
  import { useConversationFileActions } from "../../files/composables/conversation-files.js";
18
21
  import { useEmbedConfig } from "../../embed/composables/embed-config.js";
19
22
  import { usePolling } from "../../shared/composables/polling.js";
23
+ const WORKSPACE_AGENT_NOT_READY_TEXT = "O agente deste workspace ainda n\xE3o foi configurado no Tela. Abra as configura\xE7\xF5es do workspace para criar o agente.";
20
24
  function resolveTelaAgentInputs(messageInputs, configuredInputs) {
21
25
  const inputs = messageInputs ?? configuredInputs ?? void 0;
22
26
  return inputs?.length ? inputs.map((input) => ({ ...input })) : void 0;
@@ -26,7 +30,6 @@ export function useChat() {
26
30
  const embedConfig = useEmbedConfig();
27
31
  const { user: authUser, activeOrganization } = useChatAuth();
28
32
  const { addFilesToConversation } = useConversationFileActions();
29
- const isTelaAgentMode = computed(() => !!embedConfig?.telaAgentId.value);
30
33
  const chatScope = computed(() => resolveChatStateScope(
31
34
  embedConfig?.workspaceId.value || activeOrganization.value?.id,
32
35
  embedConfig?.telaAgentId.value,
@@ -64,14 +67,18 @@ export function useChat() {
64
67
  const reasoningCache = createReasoningCache();
65
68
  const processedMessages = computed(() => resolveReasoningDisplayMessages(messages.value, reasoningCache));
66
69
  const stopCondition = computed(() => !hasPendingMessage.value);
70
+ let pollGeneration = 0;
67
71
  const pollMessages = async () => {
68
72
  if (!currentConversation.value)
69
73
  return;
74
+ const generation = pollGeneration;
70
75
  try {
71
76
  const response = await $fetch(
72
77
  chatApi.path(`/conversations/${currentConversation.value.id}/messages`),
73
78
  chatApi.withChatHeaders()
74
79
  );
80
+ if (generation !== pollGeneration)
81
+ return;
75
82
  messages.value = response.messages;
76
83
  if (response.newFiles && response.newFiles.length > 0) {
77
84
  const lastAssistantMessage = response.messages.findLast((m) => m.role === "assistant");
@@ -86,13 +93,30 @@ export function useChat() {
86
93
  }
87
94
  } catch (err) {
88
95
  Sentry.captureException(err);
96
+ if (generation !== pollGeneration)
97
+ return;
98
+ const errorRecord = err && typeof err === "object" ? err : null;
99
+ const statusCode = typeof errorRecord?.statusCode === "number" ? errorRecord.statusCode : typeof errorRecord?.status === "number" ? errorRecord.status : typeof errorRecord?.response?.status === "number" ? errorRecord.response.status : null;
100
+ if (statusCode && statusCode >= 400 && statusCode < 500 && statusCode !== 408 && statusCode !== 429) {
101
+ messages.value = markPendingAssistantMessagesFailed(messages.value);
102
+ error.value = getChatApiErrorMessage(err) ?? "Erro ao atualizar mensagens";
103
+ stopPolling();
104
+ }
89
105
  }
90
106
  };
91
- const { isPolling, start: startPolling, stop: stopPolling } = usePolling({
107
+ const { isPolling, start: beginPolling, stop: endPolling } = usePolling({
92
108
  callback: pollMessages,
93
109
  interval: 500,
94
110
  stopCondition
95
111
  });
112
+ function startPolling() {
113
+ pollGeneration++;
114
+ beginPolling();
115
+ }
116
+ function stopPolling() {
117
+ pollGeneration++;
118
+ endPolling();
119
+ }
96
120
  const setConversation = (conv) => {
97
121
  const conversationMessages = "messages" in conv ? conv.messages : [];
98
122
  currentConversation.value = { ...conv, messages: conversationMessages };
@@ -127,7 +151,7 @@ export function useChat() {
127
151
  loading.value = false;
128
152
  }
129
153
  };
130
- const sendMessage = async (content, files, model, agentInputs) => {
154
+ const sendMessage = async (content, files, agentInputs) => {
131
155
  if (!currentConversation.value)
132
156
  return null;
133
157
  sending.value = true;
@@ -163,17 +187,11 @@ export function useChat() {
163
187
  };
164
188
  messages.value = [...messages.value, optimisticUserMessage, optimisticAssistantMessage];
165
189
  try {
166
- const workspaceSettingsSnapshot = embedConfig?.workspaceSettings.value;
167
190
  const resolvedAgentInputs = resolveTelaAgentInputs(agentInputs, embedConfig?.telaAgentInputs?.value);
168
191
  const body = {
169
192
  content,
170
193
  files,
171
- ...isTelaAgentMode.value ? {
172
- ...resolvedAgentInputs ? { agentInputs: resolvedAgentInputs } : {}
173
- } : {
174
- model,
175
- ...workspaceSettingsSnapshot !== void 0 ? { workspaceSettingsSnapshot } : {}
176
- }
194
+ ...resolvedAgentInputs ? { agentInputs: resolvedAgentInputs } : {}
177
195
  };
178
196
  const response = await $fetch(
179
197
  chatApi.path(`/conversations/${currentConversation.value.id}/messages`),
@@ -204,7 +222,7 @@ export function useChat() {
204
222
  (msg) => msg.id !== optimisticUserMessage.id && msg.id !== optimisticAssistantMessage.id
205
223
  );
206
224
  stopPolling();
207
- const message = err instanceof Error ? err.message : "Erro ao enviar mensagem";
225
+ const message = getChatApiErrorCode(err) === "workspace_agent_not_ready" ? WORKSPACE_AGENT_NOT_READY_TEXT : err instanceof Error ? err.message : "Erro ao enviar mensagem";
208
226
  error.value = message;
209
227
  Sentry.captureException(err);
210
228
  return null;
@@ -225,10 +243,15 @@ export function useChat() {
225
243
  cancelling.value = true;
226
244
  error.value = null;
227
245
  try {
228
- await $fetch(
246
+ const result = await $fetch(
229
247
  chatApi.path(`/conversations/${currentConversation.value.id}/cancel`),
230
248
  chatApi.withChatHeaders({ method: "POST" })
231
249
  );
250
+ if (!result.cancelled) {
251
+ messages.value = markPendingAssistantMessagesFailed(messages.value, CANCELLATION_FAILED_TEXT);
252
+ stopPolling();
253
+ return false;
254
+ }
232
255
  messages.value = markPendingAssistantMessagesInterrupted(messages.value);
233
256
  stopPolling();
234
257
  return true;
@@ -281,7 +304,7 @@ export function useChat() {
281
304
  return true;
282
305
  } catch (err) {
283
306
  messages.value = restoreAssistantMessageAfterRetryFailure(messages.value, retry.originalMessage);
284
- const errorMessage = err instanceof Error ? err.message : "Erro ao reenviar mensagem";
307
+ const errorMessage = getChatApiErrorCode(err) === "workspace_agent_not_ready" ? WORKSPACE_AGENT_NOT_READY_TEXT : err instanceof Error ? err.message : "Erro ao reenviar mensagem";
285
308
  error.value = errorMessage;
286
309
  Sentry.captureException(err);
287
310
  return false;
@@ -1,6 +1,9 @@
1
1
  import type { Message } from '../types/schemas/chat/conversations.js';
2
2
  export declare const INTERRUPTED_GENERATION_TEXT = "_Gera\u00E7\u00E3o interrompida pelo usu\u00E1rio_";
3
+ export declare const GENERATION_FAILED_TEXT = "Erro: N\u00E3o foi poss\u00EDvel concluir a resposta";
4
+ export declare const CANCELLATION_FAILED_TEXT = "Erro: N\u00E3o foi poss\u00EDvel cancelar a mensagem";
3
5
  export declare function markPendingAssistantMessagesInterrupted(messages: Message[]): Message[];
6
+ export declare function markPendingAssistantMessagesFailed(messages: Message[], content?: string): Message[];
4
7
  export declare function beginAssistantMessageRetry(messages: Message[], messageId: string): {
5
8
  messages: Message[];
6
9
  originalMessage: Message;
@@ -1,4 +1,6 @@
1
1
  export const INTERRUPTED_GENERATION_TEXT = "_Gera\xE7\xE3o interrompida pelo usu\xE1rio_";
2
+ export const GENERATION_FAILED_TEXT = "Erro: N\xE3o foi poss\xEDvel concluir a resposta";
3
+ export const CANCELLATION_FAILED_TEXT = "Erro: N\xE3o foi poss\xEDvel cancelar a mensagem";
2
4
  export function markPendingAssistantMessagesInterrupted(messages) {
3
5
  return messages.map((message) => {
4
6
  if (message.role !== "assistant" || message.status !== "pending")
@@ -10,6 +12,17 @@ export function markPendingAssistantMessagesInterrupted(messages) {
10
12
  };
11
13
  });
12
14
  }
15
+ export function markPendingAssistantMessagesFailed(messages, content = GENERATION_FAILED_TEXT) {
16
+ return messages.map((message) => {
17
+ if (message.role !== "assistant" || message.status !== "pending")
18
+ return message;
19
+ return {
20
+ ...message,
21
+ content,
22
+ status: "failed"
23
+ };
24
+ });
25
+ }
13
26
  export function beginAssistantMessageRetry(messages, messageId) {
14
27
  const originalMessage = messages.find((message) => message.id === messageId);
15
28
  if (!originalMessage || originalMessage.role !== "assistant" || originalMessage.status !== "failed")
@@ -6,12 +6,12 @@ type __VLS_Props = {
6
6
  customComponents?: Record<string, Component>;
7
7
  customHtmlTags?: readonly string[];
8
8
  };
9
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
9
+ declare const __VLS_export: import("@vue/runtime-core").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
10
10
  content: string | null;
11
11
  customComponents: Record<string, Component>;
12
12
  customHtmlTags: readonly string[];
13
13
  renderCodeBlocksAsPre: boolean;
14
14
  typewriter: boolean;
15
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
+ }, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, false, {}, any>;
16
16
  declare const _default: typeof __VLS_export;
17
17
  export default _default;
@@ -6,12 +6,12 @@ type __VLS_Props = {
6
6
  customComponents?: Record<string, Component>;
7
7
  customHtmlTags?: readonly string[];
8
8
  };
9
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
9
+ declare const __VLS_export: import("@vue/runtime-core").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
10
10
  content: string | null;
11
11
  customComponents: Record<string, Component>;
12
12
  customHtmlTags: readonly string[];
13
13
  renderCodeBlocksAsPre: boolean;
14
14
  typewriter: boolean;
15
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
+ }, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, false, {}, any>;
16
16
  declare const _default: typeof __VLS_export;
17
17
  export default _default;
@@ -6,10 +6,10 @@ type __VLS_Props = {
6
6
  initialPdfScale?: number;
7
7
  initialPdfPage?: number;
8
8
  };
9
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
9
+ declare const __VLS_export: import("@vue/runtime-core").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {
10
10
  download: () => any;
11
- }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
11
+ }, string, import("@vue/runtime-core").PublicProps, Readonly<__VLS_Props> & Readonly<{
12
12
  onDownload?: (() => any) | undefined;
13
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
+ }>, {}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, false, {}, any>;
14
14
  declare const _default: typeof __VLS_export;
15
15
  export default _default;
@@ -6,10 +6,10 @@ type __VLS_Props = {
6
6
  initialPdfScale?: number;
7
7
  initialPdfPage?: number;
8
8
  };
9
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
9
+ declare const __VLS_export: import("@vue/runtime-core").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {
10
10
  download: () => any;
11
- }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
11
+ }, string, import("@vue/runtime-core").PublicProps, Readonly<__VLS_Props> & Readonly<{
12
12
  onDownload?: (() => any) | undefined;
13
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
+ }>, {}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, false, {}, any>;
14
14
  declare const _default: typeof __VLS_export;
15
15
  export default _default;
@@ -2,6 +2,6 @@ type __VLS_Props = {
2
2
  url: string;
3
3
  name?: string;
4
4
  };
5
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
+ declare const __VLS_export: import("@vue/runtime-core").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, false, {}, any>;
6
6
  declare const _default: typeof __VLS_export;
7
7
  export default _default;
@@ -2,6 +2,6 @@ type __VLS_Props = {
2
2
  url: string;
3
3
  name?: string;
4
4
  };
5
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
+ declare const __VLS_export: import("@vue/runtime-core").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, false, {}, any>;
6
6
  declare const _default: typeof __VLS_export;
7
7
  export default _default;
@@ -1,6 +1,6 @@
1
1
  type __VLS_Props = {
2
2
  url: string;
3
3
  };
4
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
4
+ declare const __VLS_export: import("@vue/runtime-core").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, false, {}, any>;
5
5
  declare const _default: typeof __VLS_export;
6
6
  export default _default;
@@ -1,6 +1,6 @@
1
1
  type __VLS_Props = {
2
2
  url: string;
3
3
  };
4
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
4
+ declare const __VLS_export: import("@vue/runtime-core").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, false, {}, any>;
5
5
  declare const _default: typeof __VLS_export;
6
6
  export default _default;
@@ -2,6 +2,6 @@ type __VLS_Props = {
2
2
  url: string;
3
3
  alt?: string;
4
4
  };
5
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
+ declare const __VLS_export: import("@vue/runtime-core").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, false, {}, any>;
6
6
  declare const _default: typeof __VLS_export;
7
7
  export default _default;
@@ -2,6 +2,6 @@ type __VLS_Props = {
2
2
  url: string;
3
3
  alt?: string;
4
4
  };
5
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
+ declare const __VLS_export: import("@vue/runtime-core").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, false, {}, any>;
6
6
  declare const _default: typeof __VLS_export;
7
7
  export default _default;
@@ -1,6 +1,6 @@
1
1
  type __VLS_Props = {
2
2
  url: string;
3
3
  };
4
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
4
+ declare const __VLS_export: import("@vue/runtime-core").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, false, {}, any>;
5
5
  declare const _default: typeof __VLS_export;
6
6
  export default _default;
@@ -1,6 +1,6 @@
1
1
  type __VLS_Props = {
2
2
  url: string;
3
3
  };
4
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
4
+ declare const __VLS_export: import("@vue/runtime-core").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, false, {}, any>;
5
5
  declare const _default: typeof __VLS_export;
6
6
  export default _default;
@@ -2,6 +2,6 @@ import { type MarkdownNode } from '../../markdown/nodes.js';
2
2
  type __VLS_Props = {
3
3
  node?: MarkdownNode;
4
4
  };
5
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
+ declare const __VLS_export: import("@vue/runtime-core").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, false, {}, any>;
6
6
  declare const _default: typeof __VLS_export;
7
7
  export default _default;
@@ -2,6 +2,6 @@ import { type MarkdownNode } from '../../markdown/nodes.js';
2
2
  type __VLS_Props = {
3
3
  node?: MarkdownNode;
4
4
  };
5
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
+ declare const __VLS_export: import("@vue/runtime-core").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, false, {}, any>;
6
6
  declare const _default: typeof __VLS_export;
7
7
  export default _default;
@@ -2,6 +2,6 @@ type __VLS_Props = {
2
2
  url: string;
3
3
  mimeType: string;
4
4
  };
5
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
+ declare const __VLS_export: import("@vue/runtime-core").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, false, {}, any>;
6
6
  declare const _default: typeof __VLS_export;
7
7
  export default _default;
@@ -2,6 +2,6 @@ type __VLS_Props = {
2
2
  url: string;
3
3
  mimeType: string;
4
4
  };
5
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
+ declare const __VLS_export: import("@vue/runtime-core").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, false, {}, any>;
6
6
  declare const _default: typeof __VLS_export;
7
7
  export default _default;
@@ -1,6 +1,6 @@
1
1
  type __VLS_Props = {
2
2
  url: string;
3
3
  };
4
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
4
+ declare const __VLS_export: import("@vue/runtime-core").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, false, {}, any>;
5
5
  declare const _default: typeof __VLS_export;
6
6
  export default _default;
@@ -1,6 +1,6 @@
1
1
  type __VLS_Props = {
2
2
  url: string;
3
3
  };
4
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
4
+ declare const __VLS_export: import("@vue/runtime-core").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, false, {}, any>;
5
5
  declare const _default: typeof __VLS_export;
6
6
  export default _default;
@@ -1 +1,2 @@
1
1
  export declare function getChatApiErrorMessage(error: unknown): string | null;
2
+ export declare function getChatApiErrorCode(error: unknown): string | null;
@@ -10,3 +10,8 @@ export function getChatApiErrorMessage(error) {
10
10
  const data = root && isRecord(root.data) ? root.data : null;
11
11
  return stringField(data, "statusMessage") ?? stringField(data, "error") ?? stringField(data, "message") ?? stringField(root, "statusMessage") ?? stringField(root, "message");
12
12
  }
13
+ export function getChatApiErrorCode(error) {
14
+ const root = isRecord(error) ? error : null;
15
+ const data = root && isRecord(root.data) ? root.data : null;
16
+ return stringField(data, "code");
17
+ }
@@ -1,3 +1,3 @@
1
- declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
1
+ declare const __VLS_export: import("@vue/runtime-core").DefineComponent<{}, {}, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, true, {}, any>;
2
2
  declare const _default: typeof __VLS_export;
3
3
  export default _default;
@@ -1,3 +1,3 @@
1
- declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
1
+ declare const __VLS_export: import("@vue/runtime-core").DefineComponent<{}, {}, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, true, {}, any>;
2
2
  declare const _default: typeof __VLS_export;
3
3
  export default _default;
@@ -1,3 +1,3 @@
1
- declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
1
+ declare const __VLS_export: import("@vue/runtime-core").DefineComponent<{}, {}, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, true, {}, any>;
2
2
  declare const _default: typeof __VLS_export;
3
3
  export default _default;
@@ -1,3 +1,3 @@
1
- declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
1
+ declare const __VLS_export: import("@vue/runtime-core").DefineComponent<{}, {}, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, true, {}, any>;
2
2
  declare const _default: typeof __VLS_export;
3
3
  export default _default;
@@ -1,3 +1,3 @@
1
- declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
1
+ declare const __VLS_export: import("@vue/runtime-core").DefineComponent<{}, {}, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, true, {}, any>;
2
2
  declare const _default: typeof __VLS_export;
3
3
  export default _default;
@@ -1,3 +1,3 @@
1
- declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
1
+ declare const __VLS_export: import("@vue/runtime-core").DefineComponent<{}, {}, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, true, {}, any>;
2
2
  declare const _default: typeof __VLS_export;
3
3
  export default _default;
@@ -1,3 +1,3 @@
1
- declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
1
+ declare const __VLS_export: import("@vue/runtime-core").DefineComponent<{}, {}, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, true, {}, any>;
2
2
  declare const _default: typeof __VLS_export;
3
3
  export default _default;
@@ -1,3 +1,3 @@
1
- declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
1
+ declare const __VLS_export: import("@vue/runtime-core").DefineComponent<{}, {}, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, true, {}, any>;
2
2
  declare const _default: typeof __VLS_export;
3
3
  export default _default;
@@ -1,4 +1,5 @@
1
1
  export type { ChatFeatureConfig } from '../embed/feature-config.js';
2
2
  export type { ChatActor, ChatEmbedSharedProps, DefaultChatEmbedProps, MeistrariChatEmbedProps, TelaAgentChatEmbedProps, } from '../embed/types.js';
3
3
  export type { ChatActionPayload } from '../messages/composables/chat-action.js';
4
+ export type { MessageFeedbackConfig, MessageFeedbackPayload, MessageFeedbackRating, } from '../messages/composables/chat-feedback.js';
4
5
  export type { TelaAgentExecutionInput } from './schemas/integrations/tela-agent-api.js';
@@ -211,12 +211,11 @@ export declare const conversationWithMessagesSchema: z.ZodObject<{
211
211
  export type ConversationWithMessages = z.infer<typeof conversationWithMessagesSchema>;
212
212
  export declare const createConversationRequestSchema: z.ZodObject<{
213
213
  model: z.ZodOptional<z.ZodNullable<z.ZodString>>;
214
- }, z.core.$strip>;
214
+ }, z.core.$strict>;
215
215
  export type CreateConversationRequest = z.infer<typeof createConversationRequestSchema>;
216
216
  export declare const updateConversationRequestSchema: z.ZodObject<{
217
217
  title: z.ZodOptional<z.ZodString>;
218
- model: z.ZodOptional<z.ZodNullable<z.ZodString>>;
219
- }, z.core.$strip>;
218
+ }, z.core.$strict>;
220
219
  export type UpdateConversationRequest = z.infer<typeof updateConversationRequestSchema>;
221
220
  export declare const moveConversationRequestSchema: z.ZodObject<{
222
221
  groupId: z.ZodNullable<z.ZodString>;
@@ -49,12 +49,11 @@ export const conversationListMetadataSchema = z.object({
49
49
  export const conversationWithMessagesSchema = conversationSchema.extend({
50
50
  messages: z.array(messageSchema),
51
51
  });
52
- export const createConversationRequestSchema = z.object({
52
+ export const createConversationRequestSchema = z.strictObject({
53
53
  model: z.string().nullable().optional(),
54
54
  });
55
- export const updateConversationRequestSchema = z.object({
55
+ export const updateConversationRequestSchema = z.strictObject({
56
56
  title: z.string().optional(),
57
- model: z.string().nullable().optional(),
58
57
  });
59
58
  export const moveConversationRequestSchema = z.object({
60
59
  groupId: z.string().nullable(),
@@ -19,54 +19,7 @@ export declare const sendMessageBodySchema: z.ZodObject<{
19
19
  name: z.ZodString;
20
20
  content: z.ZodString;
21
21
  }, z.core.$strip>], "type">>>;
22
- model: z.ZodOptional<z.ZodString>;
23
- workspaceSettingsSnapshot: z.ZodOptional<z.ZodNullable<z.ZodObject<{
24
- systemMessage: z.ZodOptional<z.ZodNullable<z.ZodString>>;
25
- contextFiles: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
26
- url: z.ZodString;
27
- vaultReference: z.ZodOptional<z.ZodString>;
28
- name: z.ZodString;
29
- mimeType: z.ZodOptional<z.ZodString>;
30
- }, z.core.$strip>>>>;
31
- canvasTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
32
- canvasId: z.ZodString;
33
- name: z.ZodString;
34
- description: z.ZodString;
35
- variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
36
- name: z.ZodString;
37
- description: z.ZodString;
38
- type: z.ZodEnum<{
39
- file: "file";
40
- text: "text";
41
- }>;
42
- }, z.core.$strip>>>;
43
- }, z.core.$strip>>>>;
44
- knowledgeSources: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
45
- type: z.ZodEnum<{
46
- workstation: "workstation";
47
- }>;
48
- id: z.ZodString;
49
- name: z.ZodString;
50
- projectId: z.ZodString;
51
- description: z.ZodOptional<z.ZodString>;
52
- taskCount: z.ZodOptional<z.ZodNumber>;
53
- }, z.core.$strip>>>>;
54
- externalSkills: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
55
- ref: z.ZodString;
56
- name: z.ZodString;
57
- description: z.ZodString;
58
- runtime: z.ZodString;
59
- allowedTools: z.ZodArray<z.ZodString>;
60
- isPublic: z.ZodBoolean;
61
- addedBy: z.ZodObject<{
62
- userId: z.ZodString;
63
- username: z.ZodString;
64
- }, z.core.$strip>;
65
- addedAt: z.ZodString;
66
- }, z.core.$strip>>>>;
67
- updatedAt: z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodString]>>;
68
- }, z.core.$strip>>>;
69
- }, z.core.$strip>;
22
+ }, z.core.$strict>;
70
23
  export type SendMessageBody = z.infer<typeof sendMessageBodySchema>;
71
24
  export declare const sendMessageResponseSchema: z.ZodObject<{
72
25
  userMessage: z.ZodObject<{
@@ -178,3 +131,8 @@ export declare const messagePollResponseSchema: z.ZodObject<{
178
131
  }, z.core.$strip>>>;
179
132
  }, z.core.$strip>;
180
133
  export type MessagePollResponse = z.infer<typeof messagePollResponseSchema>;
134
+ export declare const cancelConversationResponseSchema: z.ZodObject<{
135
+ success: z.ZodLiteral<true>;
136
+ cancelled: z.ZodBoolean;
137
+ }, z.core.$strip>;
138
+ export type CancelConversationResponse = z.infer<typeof cancelConversationResponseSchema>;
@@ -2,13 +2,10 @@ import { z } from 'zod';
2
2
  import { telaAgentExecutionInputSchema } from '../integrations/tela-agent-api';
3
3
  import { messageSchema } from './conversations';
4
4
  import { fileUploadInputSchema, messageFileSchema } from './files';
5
- import { workspaceSettingsSnapshotSchema } from './workspace-settings';
6
- export const sendMessageBodySchema = z.object({
5
+ export const sendMessageBodySchema = z.strictObject({
7
6
  content: z.string(),
8
7
  files: z.array(fileUploadInputSchema).optional(),
9
8
  agentInputs: z.array(telaAgentExecutionInputSchema).optional(),
10
- model: z.string().optional(),
11
- workspaceSettingsSnapshot: workspaceSettingsSnapshotSchema.optional(),
12
9
  });
13
10
  export const sendMessageResponseSchema = z.object({
14
11
  userMessage: messageSchema,
@@ -18,3 +15,7 @@ export const messagePollResponseSchema = z.object({
18
15
  messages: z.array(messageSchema),
19
16
  newFiles: z.array(messageFileSchema).optional(),
20
17
  });
18
+ export const cancelConversationResponseSchema = z.object({
19
+ success: z.literal(true),
20
+ cancelled: z.boolean(),
21
+ });