@meistrari/chat-nuxt 3.3.2 → 3.5.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 (55) hide show
  1. package/dist/module.d.mts +2 -1
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +1 -0
  4. package/dist/runtime/conversations/composables/conversations.d.ts +3 -2
  5. package/dist/runtime/conversations/composables/conversations.js +35 -3
  6. package/dist/runtime/embed/components/chat-embed-inner.vue +61 -8
  7. package/dist/runtime/embed/components/chat-embed.d.vue.ts +3 -0
  8. package/dist/runtime/embed/components/chat-embed.vue +5 -1
  9. package/dist/runtime/embed/components/chat-embed.vue.d.ts +3 -0
  10. package/dist/runtime/embed/components/meistrari-chat-embed.d.vue.ts +7 -1
  11. package/dist/runtime/embed/components/meistrari-chat-embed.vue +3 -1
  12. package/dist/runtime/embed/components/meistrari-chat-embed.vue.d.ts +7 -1
  13. package/dist/runtime/embed/components/mobile/chat-mobile-shell.d.vue.ts +12 -3
  14. package/dist/runtime/embed/components/mobile/chat-mobile-shell.vue +6 -0
  15. package/dist/runtime/embed/components/mobile/chat-mobile-shell.vue.d.ts +12 -3
  16. package/dist/runtime/embed/composables/tela-agent-metadata.d.ts +2 -2
  17. package/dist/runtime/messages/components/chat-message-input.d.vue.ts +13 -4
  18. package/dist/runtime/messages/components/chat-message-input.vue +33 -0
  19. package/dist/runtime/messages/components/chat-message-input.vue.d.ts +13 -4
  20. package/dist/runtime/messages/components/chat-model-selector.d.vue.ts +14 -0
  21. package/dist/runtime/messages/components/chat-model-selector.vue +56 -0
  22. package/dist/runtime/messages/components/chat-model-selector.vue.d.ts +14 -0
  23. package/dist/runtime/messages/composables/chat-message-terminal.d.ts +17 -0
  24. package/dist/runtime/messages/composables/chat-message-terminal.js +42 -0
  25. package/dist/runtime/messages/composables/chat.d.ts +5 -0
  26. package/dist/runtime/messages/composables/chat.js +31 -4
  27. package/dist/runtime/messages/composables/mention-autocomplete.js +8 -2
  28. package/dist/runtime/shared/components/icons/anthropic.vue +1 -1
  29. package/dist/runtime/shared/components/icons/gemini.d.vue.ts +3 -0
  30. package/dist/runtime/shared/components/icons/gemini.vue +3 -0
  31. package/dist/runtime/shared/components/icons/gemini.vue.d.ts +3 -0
  32. package/dist/runtime/shared/components/icons/openai.d.vue.ts +3 -0
  33. package/dist/runtime/shared/components/icons/openai.vue +3 -0
  34. package/dist/runtime/shared/components/icons/openai.vue.d.ts +3 -0
  35. package/dist/runtime/types/embed.d.ts +3 -0
  36. package/dist/runtime/types/embed.js +1 -0
  37. package/dist/runtime/types/schemas/chat/conversations.d.ts +37 -1
  38. package/dist/runtime/types/schemas/chat/conversations.js +10 -1
  39. package/dist/runtime/types/schemas/chat/files.d.ts +3 -3
  40. package/dist/runtime/types/schemas/chat/messages.d.ts +31 -0
  41. package/dist/runtime/types/schemas/chat/messages.js +24 -0
  42. package/dist/runtime/types/schemas/chat/models.d.ts +4 -6
  43. package/dist/runtime/types/schemas/chat/models.js +3 -5
  44. package/dist/runtime/types/schemas/chat/ui.d.ts +50 -17
  45. package/dist/runtime/types/schemas/chat/ui.js +8 -5
  46. package/dist/runtime/types/schemas/chat/usage.d.ts +1 -1
  47. package/dist/runtime/types/schemas/chat/workspace-agent.d.ts +14 -0
  48. package/dist/runtime/types/schemas/chat/workspace-agent.js +7 -0
  49. package/dist/runtime/types/schemas/integrations/agent-api.d.ts +1 -1
  50. package/dist/runtime/types/schemas/integrations/tela-agent-api.d.ts +68 -6
  51. package/dist/runtime/types/schemas/integrations/tela-agent-api.js +18 -0
  52. package/dist/runtime/workspace/composables/workspace-agent-summary.d.ts +6 -0
  53. package/dist/runtime/workspace/composables/workspace-agent-summary.js +54 -0
  54. package/dist/types.d.mts +3 -1
  55. package/package.json +1 -1
@@ -2,7 +2,7 @@ import type { DeepReadonly } from 'vue';
2
2
  import type { Message } from '../../types/schemas/chat/conversations.js';
3
3
  import type { ConversationFile } from '../../types/schemas/chat/files.js';
4
4
  import type { WorkspaceSettingsResponse as WorkspaceSettings } from '../../types/schemas/chat/workspace-settings.js';
5
- import type { TelaAgentInputVariable } from '../../types/schemas/integrations/tela-agent-api.js';
5
+ import type { TelaAgentContextFile, TelaAgentInputVariable, TelaAgentSkill } from '../../types/schemas/integrations/tela-agent-api.js';
6
6
  type __VLS_Props = {
7
7
  disabled?: boolean;
8
8
  loading?: boolean;
@@ -16,19 +16,28 @@ type __VLS_Props = {
16
16
  workspaceSettings?: DeepReadonly<WorkspaceSettings> | null;
17
17
  agentInputSchema?: readonly TelaAgentInputVariable[] | null;
18
18
  agentInputSchemaLoading?: boolean;
19
+ agentSkills?: readonly TelaAgentSkill[] | null;
20
+ agentContextFiles?: readonly TelaAgentContextFile[] | null;
19
21
  showCancelButton?: boolean;
20
22
  };
21
23
  declare function addFiles(files: File[], inputName?: string): void;
22
24
  declare function setDraft(text: string): void;
23
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
25
+ type __VLS_ModelProps = {
26
+ 'selectedModel'?: string | null;
27
+ };
28
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
29
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
24
30
  addFiles: typeof addFiles;
25
31
  setDraft: typeof setDraft;
26
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
32
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
33
+ "update:selectedModel": (value: string | null) => any;
34
+ } & {
27
35
  cancel: () => any;
28
36
  send: (content: string, files: FileUploadInput[], agentInputs?: TelaAgentExecutionInput[] | undefined) => any;
29
- }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
37
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
30
38
  onCancel?: (() => any) | undefined;
31
39
  onSend?: ((content: string, files: FileUploadInput[], agentInputs?: TelaAgentExecutionInput[] | undefined) => any) | undefined;
40
+ "onUpdate:selectedModel"?: ((value: string | null) => any) | undefined;
32
41
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
33
42
  declare const _default: typeof __VLS_export;
34
43
  export default _default;
@@ -19,9 +19,12 @@ const props = defineProps({
19
19
  workspaceSettings: { type: null, required: false },
20
20
  agentInputSchema: { type: [Array, null], required: false },
21
21
  agentInputSchemaLoading: { type: Boolean, required: false },
22
+ agentSkills: { type: [Array, null], required: false },
23
+ agentContextFiles: { type: [Array, null], required: false },
22
24
  showCancelButton: { type: Boolean, required: false }
23
25
  });
24
26
  const emit = defineEmits(["send", "cancel"]);
27
+ const selectedModel = defineModel("selectedModel", { type: [String, null], ...{ default: null } });
25
28
  const { uploadFiles, uploading, uploadError } = useFileUpload();
26
29
  const isCancelEnabled = computed(() => props.showCancelButton === true);
27
30
  const content = ref("");
@@ -83,10 +86,35 @@ const fileItems = computed(() => {
83
86
  }
84
87
  }
85
88
  }
89
+ if (props.agentContextFiles) {
90
+ for (const f of props.agentContextFiles) {
91
+ if (!items.some((i) => i.id === f.path)) {
92
+ items.push({
93
+ id: f.path,
94
+ label: f.name,
95
+ description: "Contexto do agente",
96
+ icon: getMimeIcon(),
97
+ category: "file",
98
+ idKind: "path"
99
+ });
100
+ }
101
+ }
102
+ }
86
103
  return items;
87
104
  });
88
105
  const skillItems = computed(() => {
89
106
  const items = [];
107
+ if (props.agentSkills) {
108
+ for (const s of props.agentSkills) {
109
+ items.push({
110
+ id: s.path,
111
+ label: s.name,
112
+ description: s.description,
113
+ icon: "i-ph-lightning",
114
+ category: "skill"
115
+ });
116
+ }
117
+ }
90
118
  if (props.workspaceSettings?.externalSkills) {
91
119
  for (const s of props.workspaceSettings.externalSkills) {
92
120
  items.push({
@@ -633,6 +661,11 @@ defineExpose({
633
661
  @blur="handleBlur"
634
662
  />
635
663
  <div flex items-center gap-8px>
664
+ <ChatModelSelector
665
+ v-model="selectedModel"
666
+ :disabled="isLocked"
667
+ @click.stop
668
+ />
636
669
  <div flex-1 />
637
670
  <TelaTooltip :content="pendingFiles.length >= MAX_FILES ? 'Limite de arquivos atingido' : 'Anexar arquivo'" side="top">
638
671
  <TelaIconButton
@@ -2,7 +2,7 @@ import type { DeepReadonly } from 'vue';
2
2
  import type { Message } from '../../types/schemas/chat/conversations.js';
3
3
  import type { ConversationFile } from '../../types/schemas/chat/files.js';
4
4
  import type { WorkspaceSettingsResponse as WorkspaceSettings } from '../../types/schemas/chat/workspace-settings.js';
5
- import type { TelaAgentInputVariable } from '../../types/schemas/integrations/tela-agent-api.js';
5
+ import type { TelaAgentContextFile, TelaAgentInputVariable, TelaAgentSkill } from '../../types/schemas/integrations/tela-agent-api.js';
6
6
  type __VLS_Props = {
7
7
  disabled?: boolean;
8
8
  loading?: boolean;
@@ -16,19 +16,28 @@ type __VLS_Props = {
16
16
  workspaceSettings?: DeepReadonly<WorkspaceSettings> | null;
17
17
  agentInputSchema?: readonly TelaAgentInputVariable[] | null;
18
18
  agentInputSchemaLoading?: boolean;
19
+ agentSkills?: readonly TelaAgentSkill[] | null;
20
+ agentContextFiles?: readonly TelaAgentContextFile[] | null;
19
21
  showCancelButton?: boolean;
20
22
  };
21
23
  declare function addFiles(files: File[], inputName?: string): void;
22
24
  declare function setDraft(text: string): void;
23
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
25
+ type __VLS_ModelProps = {
26
+ 'selectedModel'?: string | null;
27
+ };
28
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
29
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
24
30
  addFiles: typeof addFiles;
25
31
  setDraft: typeof setDraft;
26
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
32
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
33
+ "update:selectedModel": (value: string | null) => any;
34
+ } & {
27
35
  cancel: () => any;
28
36
  send: (content: string, files: FileUploadInput[], agentInputs?: TelaAgentExecutionInput[] | undefined) => any;
29
- }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
37
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
30
38
  onCancel?: (() => any) | undefined;
31
39
  onSend?: ((content: string, files: FileUploadInput[], agentInputs?: TelaAgentExecutionInput[] | undefined) => any) | undefined;
40
+ "onUpdate:selectedModel"?: ((value: string | null) => any) | undefined;
32
41
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
33
42
  declare const _default: typeof __VLS_export;
34
43
  export default _default;
@@ -0,0 +1,14 @@
1
+ type __VLS_Props = {
2
+ disabled?: boolean;
3
+ };
4
+ type __VLS_ModelProps = {
5
+ modelValue?: string | null;
6
+ };
7
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
8
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
9
+ "update:modelValue": (value: string | null) => any;
10
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
11
+ "onUpdate:modelValue"?: ((value: string | null) => any) | undefined;
12
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
+ declare const _default: typeof __VLS_export;
14
+ export default _default;
@@ -0,0 +1,56 @@
1
+ <script setup>
2
+ import { chatModelOptions } from "../../types/schemas/chat/ui.js";
3
+ import AnthropicIcon from "../../shared/components/icons/anthropic.vue";
4
+ import GeminiIcon from "../../shared/components/icons/gemini.vue";
5
+ import OpenAiIcon from "../../shared/components/icons/openai.vue";
6
+ defineProps({
7
+ disabled: { type: Boolean, required: false }
8
+ });
9
+ const model = defineModel({ type: [String, null], ...{ default: null } });
10
+ const providerIcons = {
11
+ Anthropic: AnthropicIcon,
12
+ OpenAI: OpenAiIcon,
13
+ Google: GeminiIcon
14
+ };
15
+ const options = chatModelOptions.map((option) => ({
16
+ value: option.value,
17
+ label: option.label,
18
+ description: option.description,
19
+ group: option.provider,
20
+ icon: providerIcons[option.provider],
21
+ cost: option.cost,
22
+ maxInputTokens: option.maxInputTokens,
23
+ maxOutputTokens: option.maxOutputTokens,
24
+ isMultiModal: option.isMultiModal,
25
+ tabs: [...option.tabs]
26
+ }));
27
+ const tabLabels = {
28
+ all: "Todos",
29
+ advanced: "Avan\xE7ados",
30
+ cheap: "Econ\xF4micos",
31
+ multimodal: "Multimodal"
32
+ };
33
+ function getTabLabel(tab) {
34
+ return tabLabels[tab] ?? tab;
35
+ }
36
+ </script>
37
+
38
+ <template>
39
+ <TelaCombobox
40
+ :model-value="model ?? void 0"
41
+ :options="options"
42
+ :class="disabled && 'opacity-50 pointer-events-none'"
43
+ placeholder="Modelo"
44
+ input-placeholder="Buscar modelo..."
45
+ :get-tab-label="getTabLabel"
46
+ trigger-class="border-none!"
47
+ label-class="!text-14px !leading-18px !font-normal -tracking-0.01em! !text-gray-500"
48
+ icon-class="scale-110 mr-1px !text-gray-500"
49
+ label-item-class="!text-gray-500"
50
+ @update:model-value="model = $event ?? null"
51
+ />
52
+ </template>
53
+
54
+ <style>
55
+ [role=option] svg{color:#6b7280}
56
+ </style>
@@ -0,0 +1,14 @@
1
+ type __VLS_Props = {
2
+ disabled?: boolean;
3
+ };
4
+ type __VLS_ModelProps = {
5
+ modelValue?: string | null;
6
+ };
7
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
8
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
9
+ "update:modelValue": (value: string | null) => any;
10
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
11
+ "onUpdate:modelValue"?: ((value: string | null) => any) | undefined;
12
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
+ declare const _default: typeof __VLS_export;
14
+ export default _default;
@@ -0,0 +1,17 @@
1
+ import type { Message } from '../../types/schemas/chat/conversations.js';
2
+ export declare enum ChatMessageStatus {
3
+ Pending = "pending",
4
+ Completed = "completed",
5
+ Failed = "failed"
6
+ }
7
+ export type ChatMessageTerminalPayload = {
8
+ conversationId: string;
9
+ messageId: string;
10
+ status: ChatMessageStatus.Completed | ChatMessageStatus.Failed;
11
+ };
12
+ export type ChatMessageTerminalHandler = (payload: ChatMessageTerminalPayload) => void;
13
+ export declare function terminalMessageTransitions(previousMessages: readonly Message[], nextMessages: readonly Message[]): ChatMessageTerminalPayload[];
14
+ export declare function provideChatMessageTerminal(handler: ChatMessageTerminalHandler): void;
15
+ export declare function useChatMessageTerminal(): {
16
+ emit(payload: ChatMessageTerminalPayload): void;
17
+ };
@@ -0,0 +1,42 @@
1
+ import { inject, provide } from "vue";
2
+ export var ChatMessageStatus = /* @__PURE__ */ ((ChatMessageStatus2) => {
3
+ ChatMessageStatus2["Pending"] = "pending";
4
+ ChatMessageStatus2["Completed"] = "completed";
5
+ ChatMessageStatus2["Failed"] = "failed";
6
+ return ChatMessageStatus2;
7
+ })(ChatMessageStatus || {});
8
+ const CHAT_MESSAGE_TERMINAL_KEY = Symbol("chat-nuxt:message-terminal");
9
+ export function terminalMessageTransitions(previousMessages, nextMessages) {
10
+ const previousById = new Map(previousMessages.map((message) => [message.id, message]));
11
+ const transitions = [];
12
+ for (const message of nextMessages) {
13
+ const previous = previousById.get(message.id);
14
+ if (message.role !== "assistant" || previous?.status !== "pending" /* Pending */)
15
+ continue;
16
+ if (message.status === "completed" /* Completed */) {
17
+ transitions.push({
18
+ conversationId: message.conversationId,
19
+ messageId: message.id,
20
+ status: "completed" /* Completed */
21
+ });
22
+ } else if (message.status === "failed" /* Failed */) {
23
+ transitions.push({
24
+ conversationId: message.conversationId,
25
+ messageId: message.id,
26
+ status: "failed" /* Failed */
27
+ });
28
+ }
29
+ }
30
+ return transitions;
31
+ }
32
+ export function provideChatMessageTerminal(handler) {
33
+ provide(CHAT_MESSAGE_TERMINAL_KEY, handler);
34
+ }
35
+ export function useChatMessageTerminal() {
36
+ const handler = inject(CHAT_MESSAGE_TERMINAL_KEY, null);
37
+ return {
38
+ emit(payload) {
39
+ handler?.(payload);
40
+ }
41
+ };
42
+ }
@@ -1,6 +1,9 @@
1
+ import type { DeepReadonly } from 'vue';
1
2
  import type { Conversation, ConversationWithMessages, Message } from '../../types/schemas/chat/conversations.js';
2
3
  import type { FileUploadInput } from '../../types/schemas/chat/files.js';
4
+ import type { SendMessageBody } from '../../types/schemas/chat/messages.js';
3
5
  import type { TelaAgentExecutionInput } from '../../types/schemas/integrations/tela-agent-api.js';
6
+ export declare function resolveTelaAgentInputs(messageInputs: TelaAgentExecutionInput[] | undefined, configuredInputs: DeepReadonly<TelaAgentExecutionInput[]> | null | undefined): SendMessageBody['agentInputs'];
4
7
  export declare function useChat(): {
5
8
  currentConversation: any;
6
9
  messages: any;
@@ -14,6 +17,8 @@ export declare function useChat(): {
14
17
  animatedTitle: any;
15
18
  loadConversation: (id: string) => Promise<void>;
16
19
  setConversation: (conv: Conversation | ConversationWithMessages) => void;
20
+ setConversationModel: (model: string | null) => void;
21
+ pendingModelSelection: any;
17
22
  sendMessage: (content: string, files?: FileUploadInput[], agentInputs?: TelaAgentExecutionInput[]) => Promise<Message | null>;
18
23
  retryMessage: (messageId: string) => Promise<boolean>;
19
24
  cancelConversation: () => Promise<boolean>;
@@ -1,5 +1,6 @@
1
1
  import { useChatAuth } from "#chat-auth";
2
2
  import * as Sentry from "@sentry/nuxt";
3
+ import { defaultChatModel } from "../../types/schemas/chat/models.js";
3
4
  import {
4
5
  createReasoningCache,
5
6
  resolveReasoningDisplayMessages
@@ -20,13 +21,15 @@ import { useChatApi } from "../../shared/composables/chat-api.js";
20
21
  import { useConversationFileActions } from "../../files/composables/conversation-files.js";
21
22
  import { useEmbedConfig } from "../../embed/composables/embed-config.js";
22
23
  import { usePolling } from "../../shared/composables/polling.js";
24
+ import { terminalMessageTransitions, useChatMessageTerminal } from "./chat-message-terminal.js";
23
25
  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.";
24
- function resolveTelaAgentInputs(messageInputs, configuredInputs) {
25
- const inputs = messageInputs ?? configuredInputs ?? void 0;
26
- return inputs?.length ? inputs.map((input) => ({ ...input })) : void 0;
26
+ export function resolveTelaAgentInputs(messageInputs, configuredInputs) {
27
+ const inputs = messageInputs ?? configuredInputs;
28
+ return inputs === void 0 || inputs === null ? void 0 : inputs.map((input) => ({ ...input }));
27
29
  }
28
30
  export function useChat() {
29
31
  const chatApi = useChatApi();
32
+ const chatMessageTerminal = useChatMessageTerminal();
30
33
  const embedConfig = useEmbedConfig();
31
34
  const { user: authUser, activeOrganization } = useChatAuth();
32
35
  const { addFilesToConversation } = useConversationFileActions();
@@ -79,7 +82,10 @@ export function useChat() {
79
82
  );
80
83
  if (generation !== pollGeneration)
81
84
  return;
85
+ const terminalMessages = terminalMessageTransitions(messages.value, response.messages);
82
86
  messages.value = response.messages;
87
+ for (const terminalMessage of terminalMessages)
88
+ chatMessageTerminal.emit(terminalMessage);
83
89
  if (response.newFiles && response.newFiles.length > 0) {
84
90
  const lastAssistantMessage = response.messages.findLast((m) => m.role === "assistant");
85
91
  if (lastAssistantMessage) {
@@ -117,6 +123,25 @@ export function useChat() {
117
123
  pollGeneration++;
118
124
  endPolling();
119
125
  }
126
+ const pendingModelBuckets = useState("chat-pending-model-selection", () => ({}));
127
+ const pendingModelSelection = computed({
128
+ get: () => {
129
+ const buckets = pendingModelBuckets.value;
130
+ return chatScope.value in buckets ? buckets[chatScope.value] ?? null : defaultChatModel;
131
+ },
132
+ set: (value) => {
133
+ pendingModelBuckets.value = {
134
+ ...pendingModelBuckets.value,
135
+ [chatScope.value]: value
136
+ };
137
+ }
138
+ });
139
+ const setConversationModel = (model) => {
140
+ const conversation = currentConversation.value;
141
+ if (!conversation || conversation.model === model)
142
+ return;
143
+ currentConversation.value = { ...conversation, model };
144
+ };
120
145
  const setConversation = (conv) => {
121
146
  const conversationMessages = "messages" in conv ? conv.messages : [];
122
147
  currentConversation.value = { ...conv, messages: conversationMessages };
@@ -191,7 +216,7 @@ export function useChat() {
191
216
  const body = {
192
217
  content,
193
218
  files,
194
- ...resolvedAgentInputs ? { agentInputs: resolvedAgentInputs } : {}
219
+ ...resolvedAgentInputs !== void 0 ? { agentInputs: resolvedAgentInputs } : {}
195
220
  };
196
221
  const response = await $fetch(
197
222
  chatApi.path(`/conversations/${currentConversation.value.id}/messages`),
@@ -394,6 +419,8 @@ export function useChat() {
394
419
  animatedTitle: readonly(animatedTitle),
395
420
  loadConversation,
396
421
  setConversation,
422
+ setConversationModel,
423
+ pendingModelSelection,
397
424
  sendMessage,
398
425
  retryMessage,
399
426
  cancelConversation,
@@ -167,6 +167,8 @@ export function useMentionAutocomplete(options) {
167
167
  span.dataset.mentionId = item.id;
168
168
  span.dataset.mentionCategory = item.category;
169
169
  span.dataset.mentionLabel = item.label;
170
+ if (item.idKind)
171
+ span.dataset.mentionIdKind = item.idKind;
170
172
  if (item.description)
171
173
  span.dataset.mentionDescription = item.description;
172
174
  if (item.variables)
@@ -213,10 +215,14 @@ export function useMentionAutocomplete(options) {
213
215
  if (node.nodeType === Node.ELEMENT_NODE) {
214
216
  const el = node;
215
217
  if (el.contentEditable === "false" && el.dataset.mentionCategory) {
216
- const { mentionCategory, mentionId, mentionLabel, mentionDescription } = el.dataset;
218
+ const { mentionCategory, mentionId, mentionLabel, mentionDescription, mentionIdKind } = el.dataset;
217
219
  if (mentionCategory === "file") {
218
- const urlAttr = mentionId ? ` url="${escapeAttr(mentionId)}"` : "";
219
220
  accumulated = true;
221
+ if (mentionIdKind === "path") {
222
+ const pathAttr = mentionId ? ` path="${escapeAttr(mentionId)}"` : "";
223
+ return `<file_mention name="${escapeAttr(mentionLabel ?? "")}"${pathAttr}>Este arquivo est\xE1 no seu reposit\xF3rio de trabalho. Leia-o pelo caminho e foque nele na sua resposta.</file_mention>`;
224
+ }
225
+ const urlAttr = mentionId ? ` url="${escapeAttr(mentionId)}"` : "";
220
226
  return `<file_mention name="${escapeAttr(mentionLabel ?? "")}"${urlAttr}>Foque neste arquivo espec\xEDfico na sua resposta.</file_mention>`;
221
227
  }
222
228
  if (mentionCategory === "canvas") {
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <svg viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
2
+ <svg viewBox="0 0 24 24" width="16" height="16" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
3
3
  <path d="M13.827 3.52h3.603L24 20h-3.603l-6.57-16.48zM6.396 3.52L0 20h3.603l1.351-3.384h6.827l1.351 3.384h3.603L10.119 3.52H6.396zm.663 10.155 2.33-5.879 2.33 5.879H7.06z" />
4
4
  </svg>
5
5
  </template>
@@ -0,0 +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>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ <template>
2
+ <svg width="16" height="16" fill="currentColor" fill-rule="evenodd" viewBox="-2 -2 28 28" xmlns="http://www.w3.org/2000/svg"><path d="M12 24A14.304 14.304 0 000 12 14.304 14.304 0 0012 0a14.305 14.305 0 0012 12 14.305 14.305 0 00-12 12" /></svg>
3
+ </template>
@@ -0,0 +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>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +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>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ <template>
2
+ <svg width="16" height="16" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path fill="currentColor" d="M18.8545 10.5474C19.0334 10.0086 19.0953 9.43791 19.036 8.87334C18.9767 8.30877 18.7977 7.76335 18.5107 7.27352C18.0854 6.53313 17.4359 5.94695 16.6559 5.59949C15.876 5.25202 15.0058 5.16122 14.1709 5.34018C13.6966 4.81256 13.0917 4.41903 12.4172 4.19912C11.7426 3.97922 11.0221 3.94068 10.3279 4.08737C9.63377 4.23406 8.99043 4.56082 8.46252 5.03484C7.93461 5.50885 7.54072 6.11343 7.32041 6.78785C6.76419 6.90191 6.23872 7.13337 5.77912 7.46678C5.31951 7.80018 4.93637 8.22784 4.65528 8.72118C4.2253 9.46033 4.04153 10.3171 4.13054 11.1675C4.21955 12.018 4.57672 12.8181 5.15041 13.4522C4.97086 13.9907 4.90836 14.5614 4.96711 15.1259C5.02586 15.6905 5.2045 16.2361 5.49108 16.726C5.91697 17.4667 6.56703 18.053 7.34755 18.4005C8.12808 18.7479 8.99877 18.8386 9.83415 18.6594C10.211 19.0838 10.674 19.4229 11.1924 19.6541C11.7107 19.8852 12.2724 20.0032 12.8399 20C13.6956 20.0008 14.5295 19.7296 15.2211 19.2256C15.9127 18.7217 16.4263 18.011 16.6877 17.1961C17.2439 17.0819 17.7693 16.8503 18.2289 16.5169C18.6885 16.1835 19.0716 15.7559 19.3529 15.2627C19.7778 14.5247 19.9584 13.6711 19.8689 12.8242C19.7794 11.9773 19.4243 11.1803 18.8545 10.5474ZM12.8399 18.9528C12.139 18.9539 11.4601 18.7082 10.9223 18.2589L11.0169 18.2053L14.2024 16.3665C14.2817 16.32 14.3475 16.2537 14.3934 16.1741C14.4393 16.0944 14.4637 16.0042 14.4642 15.9123V11.421L15.8109 12.2001C15.8175 12.2035 15.8233 12.2084 15.8277 12.2144C15.8321 12.2204 15.835 12.2274 15.8362 12.2348V15.9565C15.8345 16.7507 15.5183 17.5118 14.9567 18.0734C14.3952 18.6349 13.634 18.9511 12.8399 18.9528ZM6.39941 16.2025C6.04793 15.5956 5.92173 14.8842 6.04301 14.1934L6.13768 14.2502L9.32635 16.089C9.40525 16.1353 9.49507 16.1597 9.58655 16.1597C9.67803 16.1597 9.76785 16.1353 9.84675 16.089L13.7419 13.8433V15.3982C13.7416 15.4063 13.7394 15.4142 13.7356 15.4213C13.7317 15.4284 13.7264 15.4345 13.7198 15.4392L10.4933 17.3001C9.8047 17.6968 8.98685 17.804 8.21929 17.5982C7.45173 17.3924 6.7972 16.8905 6.39941 16.2025ZM5.56048 9.26372C5.9144 8.6529 6.47304 8.187 7.13748 7.94852V11.7333C7.13628 11.8248 7.15964 11.9148 7.20513 11.9942C7.25062 12.0735 7.31656 12.1392 7.39608 12.1843L11.2723 14.4205L9.92561 15.1995C9.91833 15.2034 9.9102 15.2054 9.90195 15.2054C9.8937 15.2054 9.88557 15.2034 9.87828 15.1995L6.65808 13.3418C5.97079 12.9435 5.46938 12.2889 5.26366 11.5216C5.05794 10.7543 5.16467 9.93676 5.56048 9.24798V9.26372ZM16.6247 11.8342L12.7358 9.57598L14.0794 8.79998C14.0867 8.79611 14.0948 8.79409 14.1031 8.79409C14.1113 8.79409 14.1195 8.79611 14.1267 8.79998L17.3469 10.6608C17.8393 10.945 18.2407 11.3633 18.5043 11.8669C18.7678 12.3706 18.8826 12.9388 18.8354 13.5053C18.7881 14.0718 18.5806 14.6131 18.2372 15.0661C17.8938 15.5191 17.4286 15.8651 16.8959 16.0637V12.2788C16.8932 12.1876 16.8667 12.0986 16.8191 12.0206C16.7715 11.9427 16.7046 11.8785 16.6247 11.8342ZM17.9651 9.81885L17.8705 9.76205L14.6881 7.90752C14.6088 7.86093 14.5184 7.83637 14.4263 7.83637C14.3343 7.83637 14.2439 7.86093 14.1645 7.90752L10.2726 10.1531V8.59825C10.2718 8.59034 10.2731 8.58236 10.2764 8.57515C10.2798 8.56793 10.285 8.56175 10.2915 8.55725L13.5117 6.69952C14.0053 6.4152 14.5696 6.27728 15.1386 6.30189C15.7077 6.3265 16.258 6.51263 16.7251 6.83851C17.1923 7.16438 17.557 7.61653 17.7766 8.14207C17.9962 8.66761 18.0616 9.24482 17.9652 9.80618L17.9651 9.81885ZM9.53761 12.5753L8.19095 11.7994C8.18421 11.7954 8.17845 11.7899 8.17407 11.7834C8.16969 11.7768 8.16681 11.7694 8.16561 11.7616V8.04945C8.16636 7.47997 8.3292 6.92246 8.63512 6.44212C8.94103 5.96177 9.37736 5.57844 9.89311 5.33694C10.4089 5.09544 10.9827 5.00576 11.5475 5.07837C12.1124 5.15098 12.6449 5.38289 13.0827 5.74698L12.9881 5.80065L9.80261 7.63932C9.72333 7.68582 9.65751 7.75214 9.61161 7.83177C9.56571 7.9114 9.54131 8.0016 9.54081 8.09352L9.53761 12.5753ZM10.2693 10.9984L12.004 9.99852L13.7419 10.9984V12.998L12.0103 13.9978L10.2725 12.998L10.2693 10.9984Z" /></svg>
3
+ </template>
@@ -0,0 +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>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -2,4 +2,7 @@ export type { ChatFeatureConfig } from '../embed/feature-config.js';
2
2
  export type { ChatActor, ChatEmbedSharedProps, ChatSidebarConfig, DefaultChatEmbedProps, MeistrariChatEmbedProps, TelaAgentChatEmbedProps, } from '../embed/types.js';
3
3
  export type { ChatActionPayload } from '../messages/composables/chat-action.js';
4
4
  export type { MessageFeedbackConfig, MessageFeedbackPayload, MessageFeedbackRating, } from '../messages/composables/chat-feedback.js';
5
+ export { ChatMessageStatus } from '../messages/composables/chat-message-terminal.js';
6
+ export type { ChatMessageTerminalPayload } from '../messages/composables/chat-message-terminal.js';
7
+ export type { MessageOverviewResponse } from './schemas/chat/messages.js';
5
8
  export type { TelaAgentExecutionInput } from './schemas/integrations/tela-agent-api.js';
@@ -0,0 +1 @@
1
+ export { ChatMessageStatus } from "../messages/composables/chat-message-terminal.js";
@@ -210,11 +210,47 @@ export declare const conversationWithMessagesSchema: z.ZodObject<{
210
210
  }, z.core.$strip>;
211
211
  export type ConversationWithMessages = z.infer<typeof conversationWithMessagesSchema>;
212
212
  export declare const createConversationRequestSchema: z.ZodObject<{
213
- model: z.ZodOptional<z.ZodNullable<z.ZodString>>;
213
+ model: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
214
+ "claude-opus-4-8": "claude-opus-4-8";
215
+ "claude-sonnet-5": "claude-sonnet-5";
216
+ "claude-haiku-4-5": "claude-haiku-4-5";
217
+ }>>>;
218
+ agentInputs: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
219
+ type: z.ZodLiteral<"file">;
220
+ name: z.ZodString;
221
+ vaultRef: z.ZodString;
222
+ filename: z.ZodString;
223
+ metadata: z.ZodOptional<z.ZodString>;
224
+ }, z.core.$strip>, z.ZodObject<{
225
+ type: z.ZodLiteral<"text">;
226
+ name: z.ZodString;
227
+ content: z.ZodString;
228
+ }, z.core.$strip>], "type">>>;
214
229
  }, z.core.$strict>;
215
230
  export type CreateConversationRequest = z.infer<typeof createConversationRequestSchema>;
231
+ export declare const conversationAgentInputsResponseSchema: z.ZodObject<{
232
+ agentInputs: z.ZodNullable<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
233
+ type: z.ZodLiteral<"file">;
234
+ name: z.ZodString;
235
+ vaultRef: z.ZodString;
236
+ filename: z.ZodString;
237
+ metadata: z.ZodOptional<z.ZodString>;
238
+ }, z.core.$strip>, z.ZodObject<{
239
+ type: z.ZodLiteral<"text">;
240
+ name: z.ZodString;
241
+ content: z.ZodString;
242
+ }, z.core.$strip>], "type">>>;
243
+ configuredAt: z.ZodNullable<z.ZodDate>;
244
+ appliedAt: z.ZodNullable<z.ZodDate>;
245
+ }, z.core.$strip>;
246
+ export type ConversationAgentInputsResponse = z.infer<typeof conversationAgentInputsResponseSchema>;
216
247
  export declare const updateConversationRequestSchema: z.ZodObject<{
217
248
  title: z.ZodOptional<z.ZodString>;
249
+ model: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
250
+ "claude-opus-4-8": "claude-opus-4-8";
251
+ "claude-sonnet-5": "claude-sonnet-5";
252
+ "claude-haiku-4-5": "claude-haiku-4-5";
253
+ }>>>;
218
254
  }, z.core.$strict>;
219
255
  export type UpdateConversationRequest = z.infer<typeof updateConversationRequestSchema>;
220
256
  export declare const moveConversationRequestSchema: z.ZodObject<{
@@ -1,5 +1,7 @@
1
1
  import { z } from 'zod';
2
+ import { telaAgentExecutionInputSchema } from '../integrations/tela-agent-api';
2
3
  import { messageFileSchema } from './files';
4
+ import { chatModelSchema } from './models';
3
5
  import { conversationCreatorFilterSchema, messageRoleSchema, messageStatusSchema, } from './primitives';
4
6
  import { resolvedWorkspaceSettingsSchema } from './workspace-settings';
5
7
  export const conversationSchema = z.object({
@@ -50,10 +52,17 @@ export const conversationWithMessagesSchema = conversationSchema.extend({
50
52
  messages: z.array(messageSchema),
51
53
  });
52
54
  export const createConversationRequestSchema = z.strictObject({
53
- model: z.string().nullable().optional(),
55
+ model: chatModelSchema.nullable().optional(),
56
+ agentInputs: z.array(telaAgentExecutionInputSchema).optional(),
57
+ });
58
+ export const conversationAgentInputsResponseSchema = z.object({
59
+ agentInputs: z.array(telaAgentExecutionInputSchema).nullable(),
60
+ configuredAt: z.date().nullable(),
61
+ appliedAt: z.date().nullable(),
54
62
  });
55
63
  export const updateConversationRequestSchema = z.strictObject({
56
64
  title: z.string().optional(),
65
+ model: chatModelSchema.nullable().optional(),
57
66
  });
58
67
  export const moveConversationRequestSchema = z.object({
59
68
  groupId: z.string().nullable(),
@@ -53,8 +53,8 @@ export declare const permalinkMetadataResponseSchema: z.ZodObject<{
53
53
  export type PermalinkMetadataResponse = z.infer<typeof permalinkMetadataResponseSchema>;
54
54
  export declare const conversationFileSources: readonly ["context", "message"];
55
55
  export declare const conversationFileSourceSchema: z.ZodEnum<{
56
- context: "context";
57
56
  message: "message";
57
+ context: "context";
58
58
  }>;
59
59
  export type ConversationFileSource = z.infer<typeof conversationFileSourceSchema>;
60
60
  export declare const conversationFileSchema: z.ZodObject<{
@@ -64,8 +64,8 @@ export declare const conversationFileSchema: z.ZodObject<{
64
64
  mimeType: z.ZodString;
65
65
  vaultReference: z.ZodOptional<z.ZodString>;
66
66
  source: z.ZodEnum<{
67
- context: "context";
68
67
  message: "message";
68
+ context: "context";
69
69
  }>;
70
70
  messageId: z.ZodOptional<z.ZodString>;
71
71
  messageRole: z.ZodOptional<z.ZodEnum<{
@@ -84,8 +84,8 @@ export declare const conversationFilesResponseSchema: z.ZodObject<{
84
84
  mimeType: z.ZodString;
85
85
  vaultReference: z.ZodOptional<z.ZodString>;
86
86
  source: z.ZodEnum<{
87
- context: "context";
88
87
  message: "message";
88
+ context: "context";
89
89
  }>;
90
90
  messageId: z.ZodOptional<z.ZodString>;
91
91
  messageRole: z.ZodOptional<z.ZodEnum<{
@@ -1,4 +1,35 @@
1
1
  import { z } from 'zod';
2
+ export declare const messageOverviewResponseSchema: z.ZodObject<{
3
+ conversation: z.ZodObject<{
4
+ id: z.ZodString;
5
+ userId: z.ZodString;
6
+ model: z.ZodNullable<z.ZodString>;
7
+ }, z.core.$strict>;
8
+ message: z.ZodObject<{
9
+ id: z.ZodString;
10
+ conversationId: z.ZodString;
11
+ role: z.ZodEnum<{
12
+ user: "user";
13
+ assistant: "assistant";
14
+ }>;
15
+ status: z.ZodNullable<z.ZodEnum<{
16
+ pending: "pending";
17
+ completed: "completed";
18
+ failed: "failed";
19
+ }>>;
20
+ content: z.ZodString;
21
+ agentSessionId: z.ZodNullable<z.ZodString>;
22
+ agentSessionCursor: z.ZodNullable<z.ZodNumber>;
23
+ createdAt: z.ZodDate;
24
+ updatedAt: z.ZodNullable<z.ZodDate>;
25
+ }, z.core.$strict>;
26
+ previousUserMessage: z.ZodNullable<z.ZodObject<{
27
+ id: z.ZodString;
28
+ content: z.ZodString;
29
+ createdAt: z.ZodDate;
30
+ }, z.core.$strict>>;
31
+ }, z.core.$strict>;
32
+ export type MessageOverviewResponse = z.infer<typeof messageOverviewResponseSchema>;
2
33
  export declare const sendMessageBodySchema: z.ZodObject<{
3
34
  content: z.ZodString;
4
35
  files: z.ZodOptional<z.ZodArray<z.ZodObject<{