@orbe-agro/client-core 5.6.343 → 5.6.345
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/dist/@ecme/assets/styles/app.css +52 -26
- package/dist/@ecme/assets/styles/tailwind/index.css +52 -26
- package/dist/@ecme/components/template/Footer.js +1 -1
- package/dist/@ecme/components/view/ChatBox/ChatBox.js +3 -1
- package/dist/@ecme/components/view/ChatBox/ChatBox.js.map +1 -1
- package/dist/@ecme/components/view/ChatBox/components/ChatInput.js +19 -16
- package/dist/@ecme/components/view/ChatBox/components/ChatInput.js.map +1 -1
- package/dist/@ecme/index.js +3 -1
- package/dist/@ecme/services/AiService.js +31 -2
- package/dist/@ecme/services/AiService.js.map +1 -1
- package/dist/@ecme/services/index.js +3 -1
- package/dist/@ecme/views/concepts/ai/Chat/components/ChatView.js +55 -43
- package/dist/@ecme/views/concepts/ai/Chat/components/ChatView.js.map +1 -1
- package/dist/@ecme/views/concepts/ai/Chat/components/FormatoCard.js +81 -0
- package/dist/@ecme/views/concepts/ai/Chat/components/FormatoCard.js.map +1 -0
- package/dist/@ecme/views/concepts/ai/Chat/components/ImagensDaMensagem.js +35 -0
- package/dist/@ecme/views/concepts/ai/Chat/components/ImagensDaMensagem.js.map +1 -0
- package/dist/@ecme/views/concepts/ai/Chat/components/ModeloERaciocinio.js +142 -0
- package/dist/@ecme/views/concepts/ai/Chat/components/ModeloERaciocinio.js.map +1 -0
- package/dist/@ecme/views/concepts/ai/Chat/components/PlanilhaNaMensagem.js +47 -0
- package/dist/@ecme/views/concepts/ai/Chat/components/PlanilhaNaMensagem.js.map +1 -0
- package/dist/@ecme/views/concepts/ai/Chat/components/RelatorioNaMensagem.js +64 -0
- package/dist/@ecme/views/concepts/ai/Chat/components/RelatorioNaMensagem.js.map +1 -0
- package/dist/@ecme/views/concepts/ai/Chat/components/ToolCallChip.js +9 -4
- package/dist/@ecme/views/concepts/ai/Chat/components/ToolCallChip.js.map +1 -1
- package/dist/@ecme/views/concepts/ai/Chat/components/toolPresentation.js +18 -1
- package/dist/@ecme/views/concepts/ai/Chat/components/toolPresentation.js.map +1 -1
- package/dist/@ecme/views/concepts/ai/Chat/hooks/useChatSend.js +96 -51
- package/dist/@ecme/views/concepts/ai/Chat/hooks/useChatSend.js.map +1 -1
- package/dist/@ecme/views/concepts/ai/Chat/hooks/useImagemDoStorage.js +31 -0
- package/dist/@ecme/views/concepts/ai/Chat/hooks/useImagemDoStorage.js.map +1 -0
- package/dist/@ecme/views/concepts/ai/Chat/hooks/useModelos.js +31 -0
- package/dist/@ecme/views/concepts/ai/Chat/hooks/useModelos.js.map +1 -0
- package/dist/@ecme/views/concepts/ai/Chat/imagens.js +57 -0
- package/dist/@ecme/views/concepts/ai/Chat/imagens.js.map +1 -0
- package/dist/@ecme/views/concepts/ai/Chat/store/modeloStore.js +15 -0
- package/dist/@ecme/views/concepts/ai/Chat/store/modeloStore.js.map +1 -0
- package/dist/@types/@ecme/components/view/ChatBox/ChatBox.d.ts.map +1 -1
- package/dist/@types/@ecme/components/view/ChatBox/components/ChatInput.d.ts +3 -0
- package/dist/@types/@ecme/components/view/ChatBox/components/ChatInput.d.ts.map +1 -1
- package/dist/@types/@ecme/services/AiService.d.ts +25 -5
- package/dist/@types/@ecme/services/AiService.d.ts.map +1 -1
- package/dist/@types/@ecme/views/concepts/ai/Chat/components/ChatView.d.ts.map +1 -1
- package/dist/@types/@ecme/views/concepts/ai/Chat/components/FormatoCard.d.ts +16 -0
- package/dist/@types/@ecme/views/concepts/ai/Chat/components/FormatoCard.d.ts.map +1 -0
- package/dist/@types/@ecme/views/concepts/ai/Chat/components/ImagensDaMensagem.d.ts +13 -0
- package/dist/@types/@ecme/views/concepts/ai/Chat/components/ImagensDaMensagem.d.ts.map +1 -0
- package/dist/@types/@ecme/views/concepts/ai/Chat/components/ModeloERaciocinio.d.ts +16 -0
- package/dist/@types/@ecme/views/concepts/ai/Chat/components/ModeloERaciocinio.d.ts.map +1 -0
- package/dist/@types/@ecme/views/concepts/ai/Chat/components/PlanilhaNaMensagem.d.ts +14 -0
- package/dist/@types/@ecme/views/concepts/ai/Chat/components/PlanilhaNaMensagem.d.ts.map +1 -0
- package/dist/@types/@ecme/views/concepts/ai/Chat/components/RelatorioNaMensagem.d.ts +15 -0
- package/dist/@types/@ecme/views/concepts/ai/Chat/components/RelatorioNaMensagem.d.ts.map +1 -0
- package/dist/@types/@ecme/views/concepts/ai/Chat/components/ToolCallChip.d.ts.map +1 -1
- package/dist/@types/@ecme/views/concepts/ai/Chat/components/toolPresentation.d.ts.map +1 -1
- package/dist/@types/@ecme/views/concepts/ai/Chat/hooks/useChatSend.d.ts +3 -1
- package/dist/@types/@ecme/views/concepts/ai/Chat/hooks/useChatSend.d.ts.map +1 -1
- package/dist/@types/@ecme/views/concepts/ai/Chat/hooks/useImagemDoStorage.d.ts +16 -0
- package/dist/@types/@ecme/views/concepts/ai/Chat/hooks/useImagemDoStorage.d.ts.map +1 -0
- package/dist/@types/@ecme/views/concepts/ai/Chat/hooks/useModelos.d.ts +26 -0
- package/dist/@types/@ecme/views/concepts/ai/Chat/hooks/useModelos.d.ts.map +1 -0
- package/dist/@types/@ecme/views/concepts/ai/Chat/imagens.d.ts +27 -0
- package/dist/@types/@ecme/views/concepts/ai/Chat/imagens.d.ts.map +1 -0
- package/dist/@types/@ecme/views/concepts/ai/Chat/store/modeloStore.d.ts +27 -0
- package/dist/@types/@ecme/views/concepts/ai/Chat/store/modeloStore.d.ts.map +1 -0
- package/dist/@types/@ecme/views/concepts/ai/Chat/types.d.ts +148 -24
- package/dist/@types/@ecme/views/concepts/ai/Chat/types.d.ts.map +1 -1
- package/dist/@types/base/configs/endpoints.config/endpoints.navigation.d.ts +8 -0
- package/dist/@types/base/configs/endpoints.config/endpoints.navigation.d.ts.map +1 -1
- package/dist/@types/base/configs/endpoints.config/transportadora/contratoFrete.d.ts +8 -0
- package/dist/@types/base/configs/endpoints.config/transportadora/contratoFrete.d.ts.map +1 -1
- package/dist/@types/base/services/modules/transportadora/ContratoFrete/ContratoFreteService.d.ts +2 -0
- package/dist/@types/base/services/modules/transportadora/ContratoFrete/ContratoFreteService.d.ts.map +1 -1
- package/dist/base/assets/styles/init.css +59 -30
- package/dist/base/configs/endpoints.config/transportadora/contratoFrete.js +3 -1
- package/dist/base/configs/endpoints.config/transportadora/contratoFrete.js.map +1 -1
- package/dist/base/index.js +3 -1
- package/dist/base/services/index.js +3 -1
- package/dist/base/services/modules/index.js +3 -1
- package/dist/base/services/modules/transportadora/ContratoFrete/ContratoFreteService.js +14 -0
- package/dist/base/services/modules/transportadora/ContratoFrete/ContratoFreteService.js.map +1 -1
- package/dist/base/services/modules/transportadora/index.js +3 -1
- package/lib/@ecme/components/view/ChatBox/ChatBox.tsx +2 -0
- package/lib/@ecme/components/view/ChatBox/components/ChatInput.tsx +23 -16
- package/lib/@ecme/services/AiService.ts +57 -5
- package/lib/@ecme/views/concepts/ai/Chat/components/ChatView.tsx +59 -40
- package/lib/@ecme/views/concepts/ai/Chat/components/FormatoCard.tsx +123 -0
- package/lib/@ecme/views/concepts/ai/Chat/components/ImagensDaMensagem.tsx +54 -0
- package/lib/@ecme/views/concepts/ai/Chat/components/ModeloERaciocinio.tsx +200 -0
- package/lib/@ecme/views/concepts/ai/Chat/components/PlanilhaNaMensagem.tsx +65 -0
- package/lib/@ecme/views/concepts/ai/Chat/components/RelatorioNaMensagem.tsx +77 -0
- package/lib/@ecme/views/concepts/ai/Chat/components/ToolCallChip.tsx +18 -9
- package/lib/@ecme/views/concepts/ai/Chat/components/toolPresentation.ts +20 -0
- package/lib/@ecme/views/concepts/ai/Chat/hooks/useChatSend.ts +193 -78
- package/lib/@ecme/views/concepts/ai/Chat/hooks/useImagemDoStorage.ts +53 -0
- package/lib/@ecme/views/concepts/ai/Chat/hooks/useModelos.ts +63 -0
- package/lib/@ecme/views/concepts/ai/Chat/imagens.ts +86 -0
- package/lib/@ecme/views/concepts/ai/Chat/store/modeloStore.ts +25 -0
- package/lib/@ecme/views/concepts/ai/Chat/types.ts +157 -24
- package/lib/base/configs/endpoints.config/transportadora/contratoFrete.ts +2 -0
- package/lib/base/services/modules/transportadora/ContratoFrete/ContratoFreteService.ts +14 -0
- package/package.json +1 -1
- package/dist/@ecme/views/concepts/ai/Chat/components/EsforcoRaciocinio.js +0 -85
- package/dist/@ecme/views/concepts/ai/Chat/components/EsforcoRaciocinio.js.map +0 -1
- package/dist/@types/@ecme/views/concepts/ai/Chat/components/EsforcoRaciocinio.d.ts +0 -14
- package/dist/@types/@ecme/views/concepts/ai/Chat/components/EsforcoRaciocinio.d.ts.map +0 -1
- package/lib/@ecme/views/concepts/ai/Chat/components/EsforcoRaciocinio.tsx +0 -115
|
@@ -9,15 +9,63 @@ export type ToolCall = {
|
|
|
9
9
|
/** true enquanto a ferramenta esta executando. */
|
|
10
10
|
running: boolean
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* O que a ferramenta parada espera do usuario: a confirmacao de uma escrita
|
|
13
|
+
* ou a escolha do formato do relatorio.
|
|
13
14
|
*
|
|
14
15
|
* O backend emite `tool_start` assim que o modelo DECIDE chamar a
|
|
15
|
-
* ferramenta — antes de saber se ela
|
|
16
|
-
*
|
|
16
|
+
* ferramenta — antes de saber se ela vai pausar. Sem este campo, o chip
|
|
17
|
+
* ficaria girando "executando" enquanto na verdade espera um clique.
|
|
17
18
|
*/
|
|
18
|
-
|
|
19
|
+
aguardando?: Espera
|
|
20
|
+
/**
|
|
21
|
+
* O que a ferramenta esta fazendo agora, quando ela demora e o backend diz
|
|
22
|
+
* (ex.: "Lendo 1.200 de 4.800 registros…"). Some no `tool_end`.
|
|
23
|
+
*/
|
|
24
|
+
progresso?: string
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** O que trava uma ferramenta ate o usuario responder a pausa. */
|
|
28
|
+
export type Espera = 'confirmacao' | 'formato'
|
|
29
|
+
|
|
30
|
+
/** Os formatos do relatorio: o HTML (previa e download) ou a planilha Excel. */
|
|
31
|
+
export type FormatoDoRelatorio = 'html' | 'xlsx'
|
|
32
|
+
|
|
33
|
+
/** Uma aba da planilha, com cada linha na ordem de `colunas`, como o backend monta. */
|
|
34
|
+
export type AbaDaPlanilha = {
|
|
35
|
+
nome: string
|
|
36
|
+
colunas: string[]
|
|
37
|
+
linhas: unknown[][]
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
type RelatorioBase = {
|
|
41
|
+
id: string
|
|
42
|
+
versao: number
|
|
43
|
+
titulo: string
|
|
44
|
+
/** Nome do arquivo no download, ja com a extensao do formato. */
|
|
45
|
+
arquivo: string
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Relatorio HTML. `html` e o documento inteiro: a previa (iframe) e o download
|
|
50
|
+
* usam exatamente este texto. Personalizar gera outra versao, com outro `id`.
|
|
51
|
+
*/
|
|
52
|
+
export type RelatorioHtml = RelatorioBase & { formato: 'html'; html: string }
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Planilha Excel: as abas que o chat transforma no .xlsx, no navegador. A
|
|
56
|
+
* primeira traz os registros; a segunda, de onde eles vieram.
|
|
57
|
+
*/
|
|
58
|
+
export type PlanilhaDoChat = RelatorioBase & {
|
|
59
|
+
formato: 'xlsx'
|
|
60
|
+
abas: AbaDaPlanilha[]
|
|
19
61
|
}
|
|
20
62
|
|
|
63
|
+
/**
|
|
64
|
+
* Um relatorio gerado pelo agente, como chega no evento `report_data` e no
|
|
65
|
+
* historico. O `formato` diz qual conteudo vem.
|
|
66
|
+
*/
|
|
67
|
+
export type RelatorioDoChat = RelatorioHtml | PlanilhaDoChat
|
|
68
|
+
|
|
21
69
|
/** Operacao de escrita parada, esperando o usuario aprovar ou negar. */
|
|
22
70
|
export type PendingApproval = {
|
|
23
71
|
id: string
|
|
@@ -35,6 +83,16 @@ export type PendingInput = {
|
|
|
35
83
|
campos: string[]
|
|
36
84
|
}
|
|
37
85
|
|
|
86
|
+
/**
|
|
87
|
+
* Relatorio pedido sem o formato, esperando o usuario escolher HTML ou Excel.
|
|
88
|
+
*
|
|
89
|
+
* `chamada` e o `gerar_relatorio` pausado: o chip dele para de girar.
|
|
90
|
+
*/
|
|
91
|
+
export type PendingFormat = {
|
|
92
|
+
id: string
|
|
93
|
+
chamada: string
|
|
94
|
+
}
|
|
95
|
+
|
|
38
96
|
export type Conversation = {
|
|
39
97
|
id: string
|
|
40
98
|
sender: {
|
|
@@ -51,6 +109,14 @@ export type Conversation = {
|
|
|
51
109
|
mediaUrl: string
|
|
52
110
|
}>
|
|
53
111
|
isMyMessage?: boolean
|
|
112
|
+
/**
|
|
113
|
+
* Imagens enviadas pelo usuario nesta mensagem.
|
|
114
|
+
*
|
|
115
|
+
* Campo proprio do chat de IA, e nao o `attachments` do template: aquele
|
|
116
|
+
* exige o `File`, e a mensagem vinda do historico so tem a referencia no
|
|
117
|
+
* object storage.
|
|
118
|
+
*/
|
|
119
|
+
imagens?: ImagemDaMensagem[]
|
|
54
120
|
/**
|
|
55
121
|
* Liga a animacao de maquina de escrever do ChatCustomContent.
|
|
56
122
|
*
|
|
@@ -59,22 +125,23 @@ export type Conversation = {
|
|
|
59
125
|
* novo (ela reseta a posicao quando o conteudo muda).
|
|
60
126
|
*/
|
|
61
127
|
fresh?: boolean
|
|
128
|
+
/** A mensagem inteira e o aviso de erro: a resposta falhou sem trazer nada. */
|
|
62
129
|
isError?: boolean
|
|
130
|
+
/**
|
|
131
|
+
* A resposta falhou no meio: o texto, as ferramentas e os relatorios que ja
|
|
132
|
+
* tinham chegado ficam, e o aviso de erro aparece depois deles.
|
|
133
|
+
*/
|
|
134
|
+
falhou?: boolean
|
|
63
135
|
/** Ferramentas chamadas pelo agente nesta resposta. */
|
|
64
136
|
tools?: ToolCall[]
|
|
65
137
|
/** Preenchido quando o agente pausou esperando aprovacao humana. */
|
|
66
138
|
pendingApproval?: PendingApproval
|
|
67
139
|
/** Preenchido quando o agente pausou pedindo os dados que faltam. */
|
|
68
140
|
pendingInput?: PendingInput
|
|
69
|
-
/** Preenchido quando o agente
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
nome: string
|
|
74
|
-
colunas: string[]
|
|
75
|
-
linhas: Record<string, unknown>[]
|
|
76
|
-
}>
|
|
77
|
-
}
|
|
141
|
+
/** Preenchido quando o agente pausou pedindo o formato do relatorio. */
|
|
142
|
+
pendingFormat?: PendingFormat
|
|
143
|
+
/** Relatorios (HTML ou planilha) gerados nesta resposta, para ver e baixar. */
|
|
144
|
+
relatorios?: RelatorioDoChat[]
|
|
78
145
|
}
|
|
79
146
|
|
|
80
147
|
/**
|
|
@@ -93,6 +160,14 @@ export type ChatEvent =
|
|
|
93
160
|
type: 'tool_start'
|
|
94
161
|
data: { id: string; name: string; args: Record<string, unknown> }
|
|
95
162
|
}
|
|
163
|
+
| {
|
|
164
|
+
/**
|
|
165
|
+
* Uma ferramenta longa contou como vai (hoje, o workflow de relatorio
|
|
166
|
+
* e de estatistica). `id` e o da chamada, o mesmo do `tool_start`.
|
|
167
|
+
*/
|
|
168
|
+
type: 'tool_progress'
|
|
169
|
+
data: { id: string; texto: string }
|
|
170
|
+
}
|
|
96
171
|
| {
|
|
97
172
|
type: 'tool_end'
|
|
98
173
|
data: {
|
|
@@ -104,18 +179,11 @@ export type ChatEvent =
|
|
|
104
179
|
}
|
|
105
180
|
| {
|
|
106
181
|
/**
|
|
107
|
-
* O agente gerou
|
|
108
|
-
*
|
|
182
|
+
* O agente gerou um relatorio, HTML ou planilha (ele mesmo ou numa
|
|
183
|
+
* consulta a outra area). Chega logo depois do `tool_end` que o gerou.
|
|
109
184
|
*/
|
|
110
|
-
type: '
|
|
111
|
-
data:
|
|
112
|
-
titulo: string
|
|
113
|
-
abas: Array<{
|
|
114
|
-
nome: string
|
|
115
|
-
colunas: string[]
|
|
116
|
-
linhas: Record<string, unknown>[]
|
|
117
|
-
}>
|
|
118
|
-
}
|
|
185
|
+
type: 'report_data'
|
|
186
|
+
data: RelatorioDoChat
|
|
119
187
|
}
|
|
120
188
|
| {
|
|
121
189
|
/**
|
|
@@ -144,6 +212,17 @@ export type ChatEvent =
|
|
|
144
212
|
type: 'input_required'
|
|
145
213
|
data: { id: string; campos: string[] }
|
|
146
214
|
}
|
|
215
|
+
| {
|
|
216
|
+
/**
|
|
217
|
+
* Relatorio pedido sem o formato: o agente parou esperando o usuario
|
|
218
|
+
* escolher HTML ou Excel.
|
|
219
|
+
*
|
|
220
|
+
* Como nas outras pausas, o `done` NAO vem. Retomar e chamar
|
|
221
|
+
* `resumeChat({ formato })`; `null` = fechou sem escolher.
|
|
222
|
+
*/
|
|
223
|
+
type: 'format_required'
|
|
224
|
+
data: PendingFormat
|
|
225
|
+
}
|
|
147
226
|
| { type: 'done'; data: { content: string } }
|
|
148
227
|
| { type: 'error'; data: { message: string } }
|
|
149
228
|
|
|
@@ -187,6 +266,60 @@ export type HistoryChat = Omit<ChatHistory, 'conversation'> & {
|
|
|
187
266
|
*/
|
|
188
267
|
export type Esforco = 'minimal' | 'medium' | 'high' | 'max'
|
|
189
268
|
|
|
269
|
+
/**
|
|
270
|
+
* Um modelo que o chat oferece, como vem do GET /ai/chat/models.
|
|
271
|
+
*
|
|
272
|
+
* A lista mora no backend (`OPENROUTER_MODELOS`, no .env); o front só a
|
|
273
|
+
* mostra. O `id` vai sem tradução no corpo da mensagem, e o backend responde
|
|
274
|
+
* 422 para qualquer outro.
|
|
275
|
+
*/
|
|
276
|
+
export type ModeloOferecido = {
|
|
277
|
+
id: string
|
|
278
|
+
nome: string
|
|
279
|
+
/** false nos modelos que só leem texto: o chat desliga o envio de imagem. */
|
|
280
|
+
imagens: boolean
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/** Resposta do GET /ai/chat/models: os modelos e o que vale sem escolha. */
|
|
284
|
+
export type GetModelosResponse = {
|
|
285
|
+
padrao: string
|
|
286
|
+
modelos: ModeloOferecido[]
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Formatos de imagem aceitos no chat.
|
|
291
|
+
*
|
|
292
|
+
* O mesmo conjunto do backend (enum `TipoDeImagem`, em `imagem.py`): qualquer
|
|
293
|
+
* outro volta 422.
|
|
294
|
+
*/
|
|
295
|
+
export type TipoDeImagem = 'image/png' | 'image/jpeg' | 'image/webp'
|
|
296
|
+
|
|
297
|
+
/** Imagem como vai no corpo do /ai/chat/stream: base64 sem o prefixo `data:`. */
|
|
298
|
+
export type ImagemEnviada = {
|
|
299
|
+
mime_type: TipoDeImagem
|
|
300
|
+
base64: string
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* Imagem exibida numa mensagem do usuario.
|
|
305
|
+
*
|
|
306
|
+
* Logo apos o envio ela vem do proprio arquivo (`url`, um blob local). No
|
|
307
|
+
* historico vem so a referencia no object storage (`objectName`), baixada
|
|
308
|
+
* quando a mensagem aparece.
|
|
309
|
+
*/
|
|
310
|
+
export type ImagemDaMensagem = {
|
|
311
|
+
mimeType: string
|
|
312
|
+
url?: string
|
|
313
|
+
objectName?: string
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
/** Arquivo como o object storage devolve no download: `bytes` em base64. */
|
|
317
|
+
export type ArquivoDoStorage = {
|
|
318
|
+
contentType: string
|
|
319
|
+
bytes: string
|
|
320
|
+
fileName: string
|
|
321
|
+
}
|
|
322
|
+
|
|
190
323
|
/** Resumo de uma conversa, como vem do GET /ai/chat/conversations. */
|
|
191
324
|
export type ConversationSummary = {
|
|
192
325
|
id: string
|
|
@@ -17,6 +17,8 @@ const contratoFrete = {
|
|
|
17
17
|
enviarSap: {endpoint: `${CONTRATO_FRETE_URL}/enviar-sap/`, method: 'get'},
|
|
18
18
|
uploadArquivo: {endpoint: `${CONTRATO_FRETE_URL}/upload-arquivo`, method: 'post'},
|
|
19
19
|
findDocumento: {endpoint: `${CONTRATO_FRETE_URL}/find/documento/`, method: 'get'},
|
|
20
|
+
updateStatusPedagio: {endpoint: `${CONTRATO_FRETE_URL}/update/status-pedagio`, method: 'put'},
|
|
21
|
+
pagamentoPedagio: {endpoint: `${CONTRATO_FRETE_URL}/pagamento-pedagio`, method: 'put'},
|
|
20
22
|
}
|
|
21
23
|
export default contratoFrete
|
|
22
24
|
|
|
@@ -126,4 +126,18 @@ export async function apiFindDocumentoViagem(documento: string, tipo: string) {
|
|
|
126
126
|
url: `${CONTRATO_FRETE_PROJECT_ENDPOINT.findDocumento.endpoint}${documento}/${tipo}`,
|
|
127
127
|
method: CONTRATO_FRETE_PROJECT_ENDPOINT.findDocumento.method,
|
|
128
128
|
})
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export async function apiUpdateStatusPedagio(id: number, statusPedagio: string) {
|
|
132
|
+
return ApiService.fetchDataWithAxios<TContratoFrete>({
|
|
133
|
+
url: `${CONTRATO_FRETE_PROJECT_ENDPOINT.updateStatusPedagio.endpoint}/${id}/${statusPedagio}`,
|
|
134
|
+
method: CONTRATO_FRETE_PROJECT_ENDPOINT.updateStatusPedagio.method,
|
|
135
|
+
})
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export async function apiPagamentoPedagio(id: number) {
|
|
139
|
+
return ApiService.fetchDataWithAxios<TContratoFrete>({
|
|
140
|
+
url: `${CONTRATO_FRETE_PROJECT_ENDPOINT.pagamentoPedagio.endpoint}/${id}`,
|
|
141
|
+
method: CONTRATO_FRETE_PROJECT_ENDPOINT.pagamentoPedagio.method,
|
|
142
|
+
})
|
|
129
143
|
}
|
package/package.json
CHANGED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { TbCheck, TbBrain, TbChevronDown } from "react-icons/tb";
|
|
3
|
-
import { Dropdown } from "../../../../../components/ui/Dropdown/index.js";
|
|
4
|
-
import { useEsforcoStore } from "../store/esforcoStore.js";
|
|
5
|
-
const NIVEIS = [
|
|
6
|
-
{
|
|
7
|
-
valor: "minimal",
|
|
8
|
-
rotulo: "Mínimo",
|
|
9
|
-
descricao: "Mais rápido, para consultas diretas."
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
valor: "medium",
|
|
13
|
-
rotulo: "Médio",
|
|
14
|
-
descricao: "Equilíbrio entre rapidez e cuidado. Recomendado."
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
valor: "high",
|
|
18
|
-
rotulo: "Alto",
|
|
19
|
-
descricao: "Pensa mais antes de responder; bom para análises."
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
valor: "max",
|
|
23
|
-
rotulo: "Máximo",
|
|
24
|
-
descricao: "Pensa o máximo possível antes de responder."
|
|
25
|
-
}
|
|
26
|
-
];
|
|
27
|
-
const ehEsforco = (valor) => NIVEIS.some((nivel) => nivel.valor === valor);
|
|
28
|
-
const EsforcoRaciocinio = ({ floatingClass }) => {
|
|
29
|
-
const { esforco, setEsforco } = useEsforcoStore();
|
|
30
|
-
const atual = NIVEIS.find((nivel) => nivel.valor === esforco);
|
|
31
|
-
const handleSelect = (valor) => {
|
|
32
|
-
if (ehEsforco(valor)) {
|
|
33
|
-
setEsforco(valor);
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
return /* @__PURE__ */ jsxs(
|
|
37
|
-
Dropdown,
|
|
38
|
-
{
|
|
39
|
-
placement: "top-end",
|
|
40
|
-
activeKey: esforco,
|
|
41
|
-
menuClass: "w-72",
|
|
42
|
-
floatingClass,
|
|
43
|
-
renderTitle: /* @__PURE__ */ jsxs(
|
|
44
|
-
"button",
|
|
45
|
-
{
|
|
46
|
-
type: "button",
|
|
47
|
-
"aria-label": `Nível de raciocínio: ${atual?.rotulo}`,
|
|
48
|
-
className: "flex items-center gap-1 rounded-lg px-2 py-1 text-xs font-semibold text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-gray-100",
|
|
49
|
-
children: [
|
|
50
|
-
/* @__PURE__ */ jsx(TbBrain, { className: "text-base" }),
|
|
51
|
-
/* @__PURE__ */ jsx("span", { children: atual?.rotulo }),
|
|
52
|
-
/* @__PURE__ */ jsx(TbChevronDown, {})
|
|
53
|
-
]
|
|
54
|
-
}
|
|
55
|
-
),
|
|
56
|
-
children: [
|
|
57
|
-
/* @__PURE__ */ jsx(Dropdown.Item, { variant: "header", children: /* @__PURE__ */ jsxs("div", { className: "px-3 pb-2", children: [
|
|
58
|
-
/* @__PURE__ */ jsx("div", { className: "heading-text text-sm font-bold", children: "Raciocínio" }),
|
|
59
|
-
/* @__PURE__ */ jsx("div", { className: "text-xs text-gray-500 dark:text-gray-400", children: "Quanto o assistente pensa antes de responder." })
|
|
60
|
-
] }) }),
|
|
61
|
-
NIVEIS.map((nivel) => /* @__PURE__ */ jsxs(
|
|
62
|
-
Dropdown.Item,
|
|
63
|
-
{
|
|
64
|
-
eventKey: nivel.valor,
|
|
65
|
-
onSelect: handleSelect,
|
|
66
|
-
style: { height: "auto" },
|
|
67
|
-
className: "items-start whitespace-normal py-2",
|
|
68
|
-
children: [
|
|
69
|
-
/* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
|
|
70
|
-
/* @__PURE__ */ jsx("div", { children: nivel.rotulo }),
|
|
71
|
-
/* @__PURE__ */ jsx("div", { className: "text-xs font-normal text-gray-500 dark:text-gray-400", children: nivel.descricao })
|
|
72
|
-
] }),
|
|
73
|
-
nivel.valor === esforco && /* @__PURE__ */ jsx(TbCheck, { className: "mt-0.5 shrink-0 text-lg" })
|
|
74
|
-
]
|
|
75
|
-
},
|
|
76
|
-
nivel.valor
|
|
77
|
-
))
|
|
78
|
-
]
|
|
79
|
-
}
|
|
80
|
-
);
|
|
81
|
-
};
|
|
82
|
-
export {
|
|
83
|
-
EsforcoRaciocinio as default
|
|
84
|
-
};
|
|
85
|
-
//# sourceMappingURL=EsforcoRaciocinio.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EsforcoRaciocinio.js","sources":["../../../../../../../lib/@ecme/views/concepts/ai/Chat/components/EsforcoRaciocinio.tsx"],"sourcesContent":["import { TbBrain, TbCheck, TbChevronDown } from 'react-icons/tb'\nimport Dropdown from '@/components/ui/Dropdown'\nimport { useEsforcoStore } from '../store/esforcoStore'\nimport type { Esforco } from '../types'\n\ntype NivelDeEsforco = {\n valor: Esforco\n rotulo: string\n descricao: string\n}\n\n/** Os níveis, do menor para o maior raciocínio. Servem o botão e o menu. */\nconst NIVEIS: ReadonlyArray<NivelDeEsforco> = [\n {\n valor: 'minimal',\n rotulo: 'Mínimo',\n descricao: 'Mais rápido, para consultas diretas.',\n },\n {\n valor: 'medium',\n rotulo: 'Médio',\n descricao: 'Equilíbrio entre rapidez e cuidado. Recomendado.',\n },\n {\n valor: 'high',\n rotulo: 'Alto',\n descricao: 'Pensa mais antes de responder; bom para análises.',\n },\n {\n valor: 'max',\n rotulo: 'Máximo',\n descricao: 'Pensa o máximo possível antes de responder.',\n },\n]\n\n/** O `eventKey` do Dropdown é `string`; só um dos níveis acima é aceito. */\nconst ehEsforco = (valor: string): valor is Esforco =>\n NIVEIS.some((nivel) => nivel.valor === valor)\n\ntype EsforcoRaciocinioProps = {\n /** Classes do menu flutuante; o widget passa um z-index acima do painel. */\n floatingClass?: string\n}\n\n/**\n * Seletor do nível de raciocínio, dentro da caixa de mensagem.\n *\n * O botão mostra o nível atual; o menu abre para cima, com uma linha\n * explicando cada nível. A escolha vale para as próximas mensagens (e para as\n * retomadas de aprovação e de formulário); as respostas já dadas não mudam.\n */\nconst EsforcoRaciocinio = ({ floatingClass }: EsforcoRaciocinioProps) => {\n const { esforco, setEsforco } = useEsforcoStore()\n const atual = NIVEIS.find((nivel) => nivel.valor === esforco)\n\n const handleSelect = (valor: string) => {\n if (ehEsforco(valor)) {\n setEsforco(valor)\n }\n }\n\n return (\n <Dropdown\n placement=\"top-end\"\n activeKey={esforco}\n menuClass=\"w-72\"\n floatingClass={floatingClass}\n renderTitle={\n <button\n type=\"button\"\n aria-label={`Nível de raciocínio: ${atual?.rotulo}`}\n className=\"flex items-center gap-1 rounded-lg px-2 py-1 text-xs font-semibold text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-gray-100\"\n >\n <TbBrain className=\"text-base\" />\n <span>{atual?.rotulo}</span>\n <TbChevronDown />\n </button>\n }\n >\n <Dropdown.Item variant=\"header\">\n <div className=\"px-3 pb-2\">\n <div className=\"heading-text text-sm font-bold\">\n Raciocínio\n </div>\n <div className=\"text-xs text-gray-500 dark:text-gray-400\">\n Quanto o assistente pensa antes de responder.\n </div>\n </div>\n </Dropdown.Item>\n {NIVEIS.map((nivel) => (\n <Dropdown.Item\n key={nivel.valor}\n eventKey={nivel.valor}\n onSelect={handleSelect}\n // O MenuItem fixa 42px de altura e `nowrap`, feitos para\n // uma linha; aqui cada item tem título e descrição.\n style={{ height: 'auto' }}\n className=\"items-start whitespace-normal py-2\"\n >\n <div className=\"flex-1\">\n <div>{nivel.rotulo}</div>\n <div className=\"text-xs font-normal text-gray-500 dark:text-gray-400\">\n {nivel.descricao}\n </div>\n </div>\n {nivel.valor === esforco && (\n <TbCheck className=\"mt-0.5 shrink-0 text-lg\" />\n )}\n </Dropdown.Item>\n ))}\n </Dropdown>\n )\n}\n\nexport default EsforcoRaciocinio\n"],"names":[],"mappings":";;;;AAYA,MAAM,SAAwC;AAAA,EAC1C;AAAA,IACI,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,WAAW;AAAA,EAAA;AAAA,EAEf;AAAA,IACI,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,WAAW;AAAA,EAAA;AAAA,EAEf;AAAA,IACI,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,WAAW;AAAA,EAAA;AAAA,EAEf;AAAA,IACI,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,WAAW;AAAA,EAAA;AAEnB;AAGA,MAAM,YAAY,CAAC,UACf,OAAO,KAAK,CAAC,UAAU,MAAM,UAAU,KAAK;AAchD,MAAM,oBAAoB,CAAC,EAAE,oBAA4C;AACrE,QAAM,EAAE,SAAS,WAAA,IAAe,gBAAA;AAChC,QAAM,QAAQ,OAAO,KAAK,CAAC,UAAU,MAAM,UAAU,OAAO;AAE5D,QAAM,eAAe,CAAC,UAAkB;AACpC,QAAI,UAAU,KAAK,GAAG;AAClB,iBAAW,KAAK;AAAA,IACpB;AAAA,EACJ;AAEA,SACI;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,WAAU;AAAA,MACV,WAAW;AAAA,MACX,WAAU;AAAA,MACV;AAAA,MACA,aACI;AAAA,QAAC;AAAA,QAAA;AAAA,UACG,MAAK;AAAA,UACL,cAAY,wBAAwB,OAAO,MAAM;AAAA,UACjD,WAAU;AAAA,UAEV,UAAA;AAAA,YAAA,oBAAC,SAAA,EAAQ,WAAU,YAAA,CAAY;AAAA,YAC/B,oBAAC,QAAA,EAAM,UAAA,OAAO,OAAA,CAAO;AAAA,gCACpB,eAAA,CAAA,CAAc;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,MAIvB,UAAA;AAAA,QAAA,oBAAC,SAAS,MAAT,EAAc,SAAQ,UACnB,UAAA,qBAAC,OAAA,EAAI,WAAU,aACX,UAAA;AAAA,UAAA,oBAAC,OAAA,EAAI,WAAU,kCAAiC,UAAA,cAEhD;AAAA,UACA,oBAAC,OAAA,EAAI,WAAU,4CAA2C,UAAA,gDAAA,CAE1D;AAAA,QAAA,EAAA,CACJ,EAAA,CACJ;AAAA,QACC,OAAO,IAAI,CAAC,UACT;AAAA,UAAC,SAAS;AAAA,UAAT;AAAA,YAEG,UAAU,MAAM;AAAA,YAChB,UAAU;AAAA,YAGV,OAAO,EAAE,QAAQ,OAAA;AAAA,YACjB,WAAU;AAAA,YAEV,UAAA;AAAA,cAAA,qBAAC,OAAA,EAAI,WAAU,UACX,UAAA;AAAA,gBAAA,oBAAC,OAAA,EAAK,gBAAM,OAAA,CAAO;AAAA,gBACnB,oBAAC,OAAA,EAAI,WAAU,wDACV,gBAAM,UAAA,CACX;AAAA,cAAA,GACJ;AAAA,cACC,MAAM,UAAU,WACb,oBAAC,SAAA,EAAQ,WAAU,0BAAA,CAA0B;AAAA,YAAA;AAAA,UAAA;AAAA,UAf5C,MAAM;AAAA,QAAA,CAkBlB;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGb;"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
type EsforcoRaciocinioProps = {
|
|
2
|
-
/** Classes do menu flutuante; o widget passa um z-index acima do painel. */
|
|
3
|
-
floatingClass?: string;
|
|
4
|
-
};
|
|
5
|
-
/**
|
|
6
|
-
* Seletor do nível de raciocínio, dentro da caixa de mensagem.
|
|
7
|
-
*
|
|
8
|
-
* O botão mostra o nível atual; o menu abre para cima, com uma linha
|
|
9
|
-
* explicando cada nível. A escolha vale para as próximas mensagens (e para as
|
|
10
|
-
* retomadas de aprovação e de formulário); as respostas já dadas não mudam.
|
|
11
|
-
*/
|
|
12
|
-
declare const EsforcoRaciocinio: ({ floatingClass }: EsforcoRaciocinioProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
export default EsforcoRaciocinio;
|
|
14
|
-
//# sourceMappingURL=EsforcoRaciocinio.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EsforcoRaciocinio.d.ts","sourceRoot":"","sources":["../../../../../../../../lib/@ecme/views/concepts/ai/Chat/components/EsforcoRaciocinio.tsx"],"names":[],"mappings":"AAuCA,KAAK,sBAAsB,GAAG;IAC1B,4EAA4E;IAC5E,aAAa,CAAC,EAAE,MAAM,CAAA;CACzB,CAAA;AAED;;;;;;GAMG;AACH,QAAA,MAAM,iBAAiB,GAAI,mBAAmB,sBAAsB,4CA6DnE,CAAA;AAED,eAAe,iBAAiB,CAAA"}
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { TbBrain, TbCheck, TbChevronDown } from 'react-icons/tb'
|
|
2
|
-
import Dropdown from '@/components/ui/Dropdown'
|
|
3
|
-
import { useEsforcoStore } from '../store/esforcoStore'
|
|
4
|
-
import type { Esforco } from '../types'
|
|
5
|
-
|
|
6
|
-
type NivelDeEsforco = {
|
|
7
|
-
valor: Esforco
|
|
8
|
-
rotulo: string
|
|
9
|
-
descricao: string
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
/** Os níveis, do menor para o maior raciocínio. Servem o botão e o menu. */
|
|
13
|
-
const NIVEIS: ReadonlyArray<NivelDeEsforco> = [
|
|
14
|
-
{
|
|
15
|
-
valor: 'minimal',
|
|
16
|
-
rotulo: 'Mínimo',
|
|
17
|
-
descricao: 'Mais rápido, para consultas diretas.',
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
valor: 'medium',
|
|
21
|
-
rotulo: 'Médio',
|
|
22
|
-
descricao: 'Equilíbrio entre rapidez e cuidado. Recomendado.',
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
valor: 'high',
|
|
26
|
-
rotulo: 'Alto',
|
|
27
|
-
descricao: 'Pensa mais antes de responder; bom para análises.',
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
valor: 'max',
|
|
31
|
-
rotulo: 'Máximo',
|
|
32
|
-
descricao: 'Pensa o máximo possível antes de responder.',
|
|
33
|
-
},
|
|
34
|
-
]
|
|
35
|
-
|
|
36
|
-
/** O `eventKey` do Dropdown é `string`; só um dos níveis acima é aceito. */
|
|
37
|
-
const ehEsforco = (valor: string): valor is Esforco =>
|
|
38
|
-
NIVEIS.some((nivel) => nivel.valor === valor)
|
|
39
|
-
|
|
40
|
-
type EsforcoRaciocinioProps = {
|
|
41
|
-
/** Classes do menu flutuante; o widget passa um z-index acima do painel. */
|
|
42
|
-
floatingClass?: string
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Seletor do nível de raciocínio, dentro da caixa de mensagem.
|
|
47
|
-
*
|
|
48
|
-
* O botão mostra o nível atual; o menu abre para cima, com uma linha
|
|
49
|
-
* explicando cada nível. A escolha vale para as próximas mensagens (e para as
|
|
50
|
-
* retomadas de aprovação e de formulário); as respostas já dadas não mudam.
|
|
51
|
-
*/
|
|
52
|
-
const EsforcoRaciocinio = ({ floatingClass }: EsforcoRaciocinioProps) => {
|
|
53
|
-
const { esforco, setEsforco } = useEsforcoStore()
|
|
54
|
-
const atual = NIVEIS.find((nivel) => nivel.valor === esforco)
|
|
55
|
-
|
|
56
|
-
const handleSelect = (valor: string) => {
|
|
57
|
-
if (ehEsforco(valor)) {
|
|
58
|
-
setEsforco(valor)
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
return (
|
|
63
|
-
<Dropdown
|
|
64
|
-
placement="top-end"
|
|
65
|
-
activeKey={esforco}
|
|
66
|
-
menuClass="w-72"
|
|
67
|
-
floatingClass={floatingClass}
|
|
68
|
-
renderTitle={
|
|
69
|
-
<button
|
|
70
|
-
type="button"
|
|
71
|
-
aria-label={`Nível de raciocínio: ${atual?.rotulo}`}
|
|
72
|
-
className="flex items-center gap-1 rounded-lg px-2 py-1 text-xs font-semibold text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-gray-100"
|
|
73
|
-
>
|
|
74
|
-
<TbBrain className="text-base" />
|
|
75
|
-
<span>{atual?.rotulo}</span>
|
|
76
|
-
<TbChevronDown />
|
|
77
|
-
</button>
|
|
78
|
-
}
|
|
79
|
-
>
|
|
80
|
-
<Dropdown.Item variant="header">
|
|
81
|
-
<div className="px-3 pb-2">
|
|
82
|
-
<div className="heading-text text-sm font-bold">
|
|
83
|
-
Raciocínio
|
|
84
|
-
</div>
|
|
85
|
-
<div className="text-xs text-gray-500 dark:text-gray-400">
|
|
86
|
-
Quanto o assistente pensa antes de responder.
|
|
87
|
-
</div>
|
|
88
|
-
</div>
|
|
89
|
-
</Dropdown.Item>
|
|
90
|
-
{NIVEIS.map((nivel) => (
|
|
91
|
-
<Dropdown.Item
|
|
92
|
-
key={nivel.valor}
|
|
93
|
-
eventKey={nivel.valor}
|
|
94
|
-
onSelect={handleSelect}
|
|
95
|
-
// O MenuItem fixa 42px de altura e `nowrap`, feitos para
|
|
96
|
-
// uma linha; aqui cada item tem título e descrição.
|
|
97
|
-
style={{ height: 'auto' }}
|
|
98
|
-
className="items-start whitespace-normal py-2"
|
|
99
|
-
>
|
|
100
|
-
<div className="flex-1">
|
|
101
|
-
<div>{nivel.rotulo}</div>
|
|
102
|
-
<div className="text-xs font-normal text-gray-500 dark:text-gray-400">
|
|
103
|
-
{nivel.descricao}
|
|
104
|
-
</div>
|
|
105
|
-
</div>
|
|
106
|
-
{nivel.valor === esforco && (
|
|
107
|
-
<TbCheck className="mt-0.5 shrink-0 text-lg" />
|
|
108
|
-
)}
|
|
109
|
-
</Dropdown.Item>
|
|
110
|
-
))}
|
|
111
|
-
</Dropdown>
|
|
112
|
-
)
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
export default EsforcoRaciocinio
|