@meistrari/chat-nuxt 3.7.0 → 3.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +4 -3
- package/dist/runtime/citations/citation-links.d.ts +32 -0
- package/dist/runtime/citations/citation-links.js +56 -0
- package/dist/runtime/citations/components/chat-citation.d.vue.ts +9 -0
- package/dist/runtime/citations/components/chat-citation.vue +186 -0
- package/dist/runtime/citations/components/chat-citation.vue.d.ts +9 -0
- package/dist/runtime/citations/components/citation-document-panel.d.vue.ts +3 -0
- package/dist/runtime/citations/components/citation-document-panel.vue +241 -0
- package/dist/runtime/citations/components/citation-document-panel.vue.d.ts +3 -0
- package/dist/runtime/citations/components/citation-highlight.d.vue.ts +19 -0
- package/dist/runtime/citations/components/citation-highlight.vue +16 -0
- package/dist/runtime/citations/components/citation-highlight.vue.d.ts +19 -0
- package/dist/runtime/citations/composables/citation-panel.d.ts +8 -0
- package/dist/runtime/citations/composables/citation-panel.js +17 -0
- package/dist/runtime/citations/composables/citations.d.ts +17 -0
- package/dist/runtime/citations/composables/citations.js +44 -0
- package/dist/runtime/citations/document-highlight.d.ts +14 -0
- package/dist/runtime/citations/document-highlight.js +43 -0
- package/dist/runtime/citations/types.d.ts +57 -0
- package/dist/runtime/citations/types.js +0 -0
- package/dist/runtime/conversations/components/chat-conversation-list.vue +2 -2
- package/dist/runtime/embed/components/chat-embed-inner.vue +15 -0
- package/dist/runtime/embed/components/chat-embed.vue +2 -0
- package/dist/runtime/embed/components/configuration/chat-configuration-knowledge-sources-tab.d.vue.ts +2 -2
- package/dist/runtime/embed/components/configuration/chat-configuration-knowledge-sources-tab.vue.d.ts +2 -2
- package/dist/runtime/embed/components/meistrari-chat-embed.vue +3 -0
- package/dist/runtime/embed/components/mobile/chat-mobile-drawer.vue +2 -2
- package/dist/runtime/embed/components/mobile/chat-mobile-shell.d.vue.ts +2 -2
- package/dist/runtime/embed/components/mobile/chat-mobile-shell.vue.d.ts +2 -2
- package/dist/runtime/embed/composables/embed-config.d.ts +3 -0
- package/dist/runtime/embed/composables/embed-config.js +9 -0
- package/dist/runtime/embed/types.d.ts +12 -1
- package/dist/runtime/files/components/chat-vault-link.vue +13 -0
- package/dist/runtime/files/content-detection.d.ts +9 -1
- package/dist/runtime/files/content-detection.js +29 -8
- package/dist/runtime/messages/components/chat-message-bubble.vue +7 -3
- package/dist/runtime/messages/components/reasoning/chat-reasoning-message.vue +22 -266
- package/dist/runtime/messages/components/reasoning/chat-reasoning-thought.vue +2 -3
- package/dist/runtime/messages/tool-registry.d.ts +15 -0
- package/dist/runtime/messages/tool-registry.js +138 -0
- package/dist/runtime/types/citations.d.ts +1 -0
- package/dist/runtime/types/citations.js +0 -0
- package/dist/runtime/types/embed.d.ts +1 -0
- package/package.json +1 -1
- package/dist/runtime/messages/composables/tool-formatting.d.ts +0 -5
- package/dist/runtime/messages/composables/tool-formatting.js +0 -61
- package/dist/runtime/shared/composables/verb-conjugation.d.ts +0 -7
- package/dist/runtime/shared/composables/verb-conjugation.js +0 -269
|
@@ -1,269 +0,0 @@
|
|
|
1
|
-
const pt = {
|
|
2
|
-
buscar: { infinitive: "buscar", gerund: "Buscando", past: "Buscou" },
|
|
3
|
-
listar: { infinitive: "listar", gerund: "Listando", past: "Listou" },
|
|
4
|
-
encontrar: { infinitive: "encontrar", gerund: "Encontrando", past: "Encontrou" },
|
|
5
|
-
ler: { infinitive: "ler", gerund: "Lendo", past: "Leu" },
|
|
6
|
-
escrever: { infinitive: "escrever", gerund: "Escrevendo", past: "Escreveu" },
|
|
7
|
-
criar: { infinitive: "criar", gerund: "Criando", past: "Criou" },
|
|
8
|
-
deletar: { infinitive: "deletar", gerund: "Deletando", past: "Deletou" },
|
|
9
|
-
remover: { infinitive: "remover", gerund: "Removendo", past: "Removeu" },
|
|
10
|
-
copiar: { infinitive: "copiar", gerund: "Copiando", past: "Copiou" },
|
|
11
|
-
mover: { infinitive: "mover", gerund: "Movendo", past: "Moveu" },
|
|
12
|
-
executar: { infinitive: "executar", gerund: "Executando", past: "Executou" },
|
|
13
|
-
verificar: { infinitive: "verificar", gerund: "Verificando", past: "Verificou" },
|
|
14
|
-
instalar: { infinitive: "instalar", gerund: "Instalando", past: "Instalou" },
|
|
15
|
-
atualizar: { infinitive: "atualizar", gerund: "Atualizando", past: "Atualizou" },
|
|
16
|
-
construir: { infinitive: "construir", gerund: "Construindo", past: "Construiu" },
|
|
17
|
-
compilar: { infinitive: "compilar", gerund: "Compilando", past: "Compilou" },
|
|
18
|
-
testar: { infinitive: "testar", gerund: "Testando", past: "Testou" },
|
|
19
|
-
iniciar: { infinitive: "iniciar", gerund: "Iniciando", past: "Iniciou" },
|
|
20
|
-
parar: { infinitive: "parar", gerund: "Parando", past: "Parou" },
|
|
21
|
-
reiniciar: { infinitive: "reiniciar", gerund: "Reiniciando", past: "Reiniciou" },
|
|
22
|
-
carregar: { infinitive: "carregar", gerund: "Carregando", past: "Carregou" },
|
|
23
|
-
salvar: { infinitive: "salvar", gerund: "Salvando", past: "Salvou" },
|
|
24
|
-
baixar: { infinitive: "baixar", gerund: "Baixando", past: "Baixou" },
|
|
25
|
-
enviar: { infinitive: "enviar", gerund: "Enviando", past: "Enviou" },
|
|
26
|
-
analisar: { infinitive: "analisar", gerund: "Analisando", past: "Analisou" },
|
|
27
|
-
processar: { infinitive: "processar", gerund: "Processando", past: "Processou" },
|
|
28
|
-
obter: { infinitive: "obter", gerund: "Obtendo", past: "Obteve" },
|
|
29
|
-
definir: { infinitive: "definir", gerund: "Definindo", past: "Definiu" },
|
|
30
|
-
abrir: { infinitive: "abrir", gerund: "Abrindo", past: "Abriu" },
|
|
31
|
-
fechar: { infinitive: "fechar", gerund: "Fechando", past: "Fechou" },
|
|
32
|
-
escanear: { infinitive: "escanear", gerund: "Escaneando", past: "Escaneou" },
|
|
33
|
-
monitorar: { infinitive: "monitorar", gerund: "Monitorando", past: "Monitorou" },
|
|
34
|
-
aguardar: { infinitive: "aguardar", gerund: "Aguardando", past: "Aguardou" },
|
|
35
|
-
procurar: { infinitive: "procurar", gerund: "Procurando", past: "Procurou" },
|
|
36
|
-
explorar: { infinitive: "explorar", gerund: "Explorando", past: "Explorou" },
|
|
37
|
-
modificar: { infinitive: "modificar", gerund: "Modificando", past: "Modificou" },
|
|
38
|
-
alterar: { infinitive: "alterar", gerund: "Alterando", past: "Alterou" },
|
|
39
|
-
adicionar: { infinitive: "adicionar", gerund: "Adicionando", past: "Adicionou" },
|
|
40
|
-
renomear: { infinitive: "renomear", gerund: "Renomeando", past: "Renomeou" },
|
|
41
|
-
configurar: { infinitive: "configurar", gerund: "Configurando", past: "Configurou" },
|
|
42
|
-
preparar: { infinitive: "preparar", gerund: "Preparando", past: "Preparou" },
|
|
43
|
-
exibir: { infinitive: "exibir", gerund: "Exibindo", past: "Exibiu" },
|
|
44
|
-
limpar: { infinitive: "limpar", gerund: "Limpando", past: "Limpou" },
|
|
45
|
-
filtrar: { infinitive: "filtrar", gerund: "Filtrando", past: "Filtrou" },
|
|
46
|
-
ordenar: { infinitive: "ordenar", gerund: "Ordenando", past: "Ordenou" },
|
|
47
|
-
contar: { infinitive: "contar", gerund: "Contando", past: "Contou" },
|
|
48
|
-
comparar: { infinitive: "comparar", gerund: "Comparando", past: "Comparou" },
|
|
49
|
-
extrair: { infinitive: "extrair", gerund: "Extraindo", past: "Extraiu" },
|
|
50
|
-
comprimir: { infinitive: "comprimir", gerund: "Comprimindo", past: "Comprimiu" },
|
|
51
|
-
descomprimir: { infinitive: "descomprimir", gerund: "Descomprimindo", past: "Descomprimiu" },
|
|
52
|
-
consultar: { infinitive: "consultar", gerund: "Consultando", past: "Consultou" },
|
|
53
|
-
navegar: { infinitive: "navegar", gerund: "Navegando", past: "Navegou" },
|
|
54
|
-
trocar: { infinitive: "trocar", gerund: "Trocando", past: "Trocou" },
|
|
55
|
-
gerenciar: { infinitive: "gerenciar", gerund: "Gerenciando", past: "Gerenciou" },
|
|
56
|
-
apagar: { infinitive: "apagar", gerund: "Apagando", past: "Apagou" },
|
|
57
|
-
rodar: { infinitive: "rodar", gerund: "Rodando", past: "Rodou" },
|
|
58
|
-
subir: { infinitive: "subir", gerund: "Subindo", past: "Subiu" },
|
|
59
|
-
fazer: { infinitive: "fazer", gerund: "Fazendo", past: "Fez" }
|
|
60
|
-
};
|
|
61
|
-
function verb(key) {
|
|
62
|
-
return pt[key];
|
|
63
|
-
}
|
|
64
|
-
const englishToPortuguese = {
|
|
65
|
-
search: verb("buscar"),
|
|
66
|
-
searching: verb("buscar"),
|
|
67
|
-
list: verb("listar"),
|
|
68
|
-
listing: verb("listar"),
|
|
69
|
-
find: verb("encontrar"),
|
|
70
|
-
finding: verb("encontrar"),
|
|
71
|
-
read: verb("ler"),
|
|
72
|
-
reading: verb("ler"),
|
|
73
|
-
write: verb("escrever"),
|
|
74
|
-
writing: verb("escrever"),
|
|
75
|
-
create: verb("criar"),
|
|
76
|
-
creating: verb("criar"),
|
|
77
|
-
delete: verb("deletar"),
|
|
78
|
-
deleting: verb("deletar"),
|
|
79
|
-
remove: verb("remover"),
|
|
80
|
-
removing: verb("remover"),
|
|
81
|
-
copy: verb("copiar"),
|
|
82
|
-
copying: verb("copiar"),
|
|
83
|
-
move: verb("mover"),
|
|
84
|
-
moving: verb("mover"),
|
|
85
|
-
execute: verb("executar"),
|
|
86
|
-
executing: verb("executar"),
|
|
87
|
-
run: verb("executar"),
|
|
88
|
-
running: verb("executar"),
|
|
89
|
-
check: verb("verificar"),
|
|
90
|
-
checking: verb("verificar"),
|
|
91
|
-
verify: verb("verificar"),
|
|
92
|
-
verifying: verb("verificar"),
|
|
93
|
-
install: verb("instalar"),
|
|
94
|
-
installing: verb("instalar"),
|
|
95
|
-
update: verb("atualizar"),
|
|
96
|
-
updating: verb("atualizar"),
|
|
97
|
-
build: verb("construir"),
|
|
98
|
-
building: verb("construir"),
|
|
99
|
-
compile: verb("compilar"),
|
|
100
|
-
compiling: verb("compilar"),
|
|
101
|
-
test: verb("testar"),
|
|
102
|
-
testing: verb("testar"),
|
|
103
|
-
start: verb("iniciar"),
|
|
104
|
-
starting: verb("iniciar"),
|
|
105
|
-
stop: verb("parar"),
|
|
106
|
-
stopping: verb("parar"),
|
|
107
|
-
restart: verb("reiniciar"),
|
|
108
|
-
restarting: verb("reiniciar"),
|
|
109
|
-
load: verb("carregar"),
|
|
110
|
-
loading: verb("carregar"),
|
|
111
|
-
save: verb("salvar"),
|
|
112
|
-
saving: verb("salvar"),
|
|
113
|
-
download: verb("baixar"),
|
|
114
|
-
downloading: verb("baixar"),
|
|
115
|
-
upload: verb("enviar"),
|
|
116
|
-
uploading: verb("enviar"),
|
|
117
|
-
analyze: verb("analisar"),
|
|
118
|
-
analyzing: verb("analisar"),
|
|
119
|
-
process: verb("processar"),
|
|
120
|
-
processing: verb("processar"),
|
|
121
|
-
parse: verb("processar"),
|
|
122
|
-
parsing: verb("processar"),
|
|
123
|
-
fetch: verb("buscar"),
|
|
124
|
-
fetching: verb("buscar"),
|
|
125
|
-
get: verb("obter"),
|
|
126
|
-
getting: verb("obter"),
|
|
127
|
-
set: verb("definir"),
|
|
128
|
-
setting: verb("definir"),
|
|
129
|
-
open: verb("abrir"),
|
|
130
|
-
opening: verb("abrir"),
|
|
131
|
-
close: verb("fechar"),
|
|
132
|
-
closing: verb("fechar"),
|
|
133
|
-
scan: verb("escanear"),
|
|
134
|
-
scanning: verb("escanear"),
|
|
135
|
-
monitor: verb("monitorar"),
|
|
136
|
-
monitoring: verb("monitorar"),
|
|
137
|
-
wait: verb("aguardar"),
|
|
138
|
-
waiting: verb("aguardar"),
|
|
139
|
-
look: verb("procurar"),
|
|
140
|
-
looking: verb("procurar"),
|
|
141
|
-
navigate: verb("navegar"),
|
|
142
|
-
navigating: verb("navegar"),
|
|
143
|
-
explore: verb("explorar"),
|
|
144
|
-
exploring: verb("explorar"),
|
|
145
|
-
modify: verb("modificar"),
|
|
146
|
-
modifying: verb("modificar"),
|
|
147
|
-
change: verb("alterar"),
|
|
148
|
-
changing: verb("alterar"),
|
|
149
|
-
add: verb("adicionar"),
|
|
150
|
-
adding: verb("adicionar"),
|
|
151
|
-
rename: verb("renomear"),
|
|
152
|
-
renaming: verb("renomear"),
|
|
153
|
-
configure: verb("configurar"),
|
|
154
|
-
configuring: verb("configurar"),
|
|
155
|
-
prepare: verb("preparar"),
|
|
156
|
-
preparing: verb("preparar"),
|
|
157
|
-
display: verb("exibir"),
|
|
158
|
-
displaying: verb("exibir"),
|
|
159
|
-
show: verb("exibir"),
|
|
160
|
-
showing: verb("exibir"),
|
|
161
|
-
clean: verb("limpar"),
|
|
162
|
-
cleaning: verb("limpar"),
|
|
163
|
-
clear: verb("limpar"),
|
|
164
|
-
clearing: verb("limpar"),
|
|
165
|
-
match: verb("encontrar"),
|
|
166
|
-
matching: verb("encontrar"),
|
|
167
|
-
filter: verb("filtrar"),
|
|
168
|
-
filtering: verb("filtrar"),
|
|
169
|
-
sort: verb("ordenar"),
|
|
170
|
-
sorting: verb("ordenar"),
|
|
171
|
-
count: verb("contar"),
|
|
172
|
-
counting: verb("contar"),
|
|
173
|
-
compare: verb("comparar"),
|
|
174
|
-
comparing: verb("comparar"),
|
|
175
|
-
extract: verb("extrair"),
|
|
176
|
-
extracting: verb("extrair"),
|
|
177
|
-
compress: verb("comprimir"),
|
|
178
|
-
compressing: verb("comprimir"),
|
|
179
|
-
decompress: verb("descomprimir"),
|
|
180
|
-
decompressing: verb("descomprimir")
|
|
181
|
-
};
|
|
182
|
-
const ptValues = Object.values(pt);
|
|
183
|
-
const gerundToPast = new Map(
|
|
184
|
-
ptValues.map((v) => [v.gerund, v.past])
|
|
185
|
-
);
|
|
186
|
-
const infinitiveToPast = new Map(
|
|
187
|
-
ptValues.map((v) => [v.infinitive, v.past])
|
|
188
|
-
);
|
|
189
|
-
const readFileStepLabels = {
|
|
190
|
-
"instructions.md": "instru\xE7\xF5es",
|
|
191
|
-
"output-format.json": "estrutura de sa\xEDda esperada",
|
|
192
|
-
"input-list.json": "lista de arquivos de entrada",
|
|
193
|
-
"result.json": "resultado"
|
|
194
|
-
};
|
|
195
|
-
export function useVerbConjugation() {
|
|
196
|
-
function isEnglish(text) {
|
|
197
|
-
const firstWord = text.trim().split(/\s+/)[0]?.toLowerCase() || "";
|
|
198
|
-
if (firstWord in englishToPortuguese) {
|
|
199
|
-
return true;
|
|
200
|
-
}
|
|
201
|
-
const englishPatterns = [
|
|
202
|
-
/^(search|list|find|read|write|create|delete|remove|copy|move|execute|run|check|verify)/i,
|
|
203
|
-
/\s(for|in|from|to|with|at|of|the|a|an)\s/i,
|
|
204
|
-
/files?|director(y|ies)|input|output|data/i
|
|
205
|
-
];
|
|
206
|
-
return englishPatterns.some((pattern) => pattern.test(text));
|
|
207
|
-
}
|
|
208
|
-
function translateEnglishText(text, toPast) {
|
|
209
|
-
const words = text.trim().split(/\s+/);
|
|
210
|
-
const firstWord = words[0]?.toLowerCase();
|
|
211
|
-
if (!firstWord) {
|
|
212
|
-
return text;
|
|
213
|
-
}
|
|
214
|
-
if (firstWord in englishToPortuguese) {
|
|
215
|
-
const verb2 = englishToPortuguese[firstWord];
|
|
216
|
-
if (!verb2) {
|
|
217
|
-
return text;
|
|
218
|
-
}
|
|
219
|
-
const restOfSentence = words.slice(1).join(" ");
|
|
220
|
-
const translatedRest = restOfSentence.replace(/\bfor\b/gi, "por").replace(/\bin\b/gi, "em").replace(/\bfrom\b/gi, "de").replace(/\bto\b/gi, "para").replace(/\bwith\b/gi, "com").replace(/\bfiles?\b/gi, "arquivos").replace(/\bdirector(y|ies)\b/gi, (_match, suffix) => suffix === "ies" ? "diret\xF3rios" : "diret\xF3rio").replace(/\binput\b/gi, "entrada").replace(/\boutput\b/gi, "sa\xEDda").replace(/\bdata\b/gi, "dados");
|
|
221
|
-
const conjugatedVerb = toPast ? verb2.past : verb2.gerund;
|
|
222
|
-
return translatedRest ? `${conjugatedVerb} ${translatedRest}` : conjugatedVerb;
|
|
223
|
-
}
|
|
224
|
-
return text;
|
|
225
|
-
}
|
|
226
|
-
function conjugatePortugueseVerb(text) {
|
|
227
|
-
for (const [gerund, past] of gerundToPast) {
|
|
228
|
-
if (text.startsWith(gerund)) {
|
|
229
|
-
return text.replace(gerund, past);
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
for (const [infinitive, past] of infinitiveToPast) {
|
|
233
|
-
const regex = new RegExp(`^${infinitive}(\\s|$)`, "i");
|
|
234
|
-
if (regex.test(text)) {
|
|
235
|
-
return text.replace(regex, `${past}$1`);
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
let result = text;
|
|
239
|
-
result = result.replace(/^(\w)(\w*)ando(\s|$)/i, (_, first, rest, space) => `${first.toUpperCase()}${rest}ou${space}`);
|
|
240
|
-
result = result.replace(/^(\w)(\w*)endo(\s|$)/i, (_, first, rest, space) => `${first.toUpperCase()}${rest}eu${space}`);
|
|
241
|
-
result = result.replace(/^(\w)(\w*)indo(\s|$)/i, (_, first, rest, space) => `${first.toUpperCase()}${rest}iu${space}`);
|
|
242
|
-
result = result.replace(/^(\w)(\w*)ar(\s|$)/i, (_, first, rest, space) => `${first.toUpperCase()}${rest}ou${space}`);
|
|
243
|
-
result = result.replace(/^(\w)(\w*)er(\s|$)/i, (_, first, rest, space) => `${first.toUpperCase()}${rest}eu${space}`);
|
|
244
|
-
result = result.replace(/^(\w)(\w*)ir(\s|$)/i, (_, first, rest, space) => `${first.toUpperCase()}${rest}iu${space}`);
|
|
245
|
-
return result;
|
|
246
|
-
}
|
|
247
|
-
function conjugateText(text, wasExecuted) {
|
|
248
|
-
if (!wasExecuted) {
|
|
249
|
-
return text;
|
|
250
|
-
}
|
|
251
|
-
if (isEnglish(text)) {
|
|
252
|
-
return translateEnglishText(text, true);
|
|
253
|
-
}
|
|
254
|
-
return conjugatePortugueseVerb(text);
|
|
255
|
-
}
|
|
256
|
-
function resolveReadFileStepTitle(fileName, wasExecuted) {
|
|
257
|
-
const label = readFileStepLabels[fileName];
|
|
258
|
-
if (!label)
|
|
259
|
-
return null;
|
|
260
|
-
return conjugateText(`Lendo ${label}`, wasExecuted);
|
|
261
|
-
}
|
|
262
|
-
return {
|
|
263
|
-
conjugateText,
|
|
264
|
-
isEnglish,
|
|
265
|
-
translateEnglishText,
|
|
266
|
-
conjugatePortugueseVerb,
|
|
267
|
-
resolveReadFileStepTitle
|
|
268
|
-
};
|
|
269
|
-
}
|