@orbe-agro/client-core 5.6.339 → 5.6.341
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 +47 -26
- package/dist/@ecme/assets/styles/tailwind/index.css +47 -26
- package/dist/@ecme/components/template/Footer.js +1 -1
- package/dist/@ecme/components/view/ChatBox/components/ChatInput.js +3 -2
- package/dist/@ecme/components/view/ChatBox/components/ChatInput.js.map +1 -1
- package/dist/@ecme/index.js +2 -1
- package/dist/@ecme/services/AiService.js +19 -2
- package/dist/@ecme/services/AiService.js.map +1 -1
- package/dist/@ecme/services/index.js +2 -1
- package/dist/@ecme/views/concepts/ai/Chat/components/ChatView.js +42 -40
- 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/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 +7 -3
- package/dist/@ecme/views/concepts/ai/Chat/components/ToolCallChip.js.map +1 -1
- package/dist/@ecme/views/concepts/ai/Chat/components/toolPresentation.js +12 -1
- package/dist/@ecme/views/concepts/ai/Chat/components/toolPresentation.js.map +1 -1
- package/dist/@ecme/views/concepts/ai/Chat/hooks/useChatSend.js +47 -33
- package/dist/@ecme/views/concepts/ai/Chat/hooks/useChatSend.js.map +1 -1
- 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/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/components/ChatInput.d.ts +2 -2
- package/dist/@types/@ecme/components/view/ChatBox/components/ChatInput.d.ts.map +1 -1
- package/dist/@types/@ecme/services/AiService.d.ts +15 -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/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 +2 -0
- package/dist/@types/@ecme/views/concepts/ai/Chat/hooks/useChatSend.d.ts.map +1 -1
- 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/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 +89 -24
- package/dist/@types/@ecme/views/concepts/ai/Chat/types.d.ts.map +1 -1
- package/dist/@types/base/configs/endpoints.config/compras/compras.d.ts +16 -0
- package/dist/@types/base/configs/endpoints.config/compras/compras.d.ts.map +1 -1
- package/dist/@types/base/configs/endpoints.config/compras/config/itemOrdemCompra.d.ts +12 -0
- package/dist/@types/base/configs/endpoints.config/compras/config/itemOrdemCompra.d.ts.map +1 -1
- package/dist/@types/base/configs/endpoints.config/compras/config/ordemCompra.d.ts +4 -0
- package/dist/@types/base/configs/endpoints.config/compras/config/ordemCompra.d.ts.map +1 -1
- package/dist/@types/base/configs/endpoints.config/endpoints.navigation.d.ts +16 -0
- package/dist/@types/base/configs/endpoints.config/endpoints.navigation.d.ts.map +1 -1
- package/dist/@types/base/services/modules/compras/ordemCompra/ItemOrdemCompraService.d.ts +6 -0
- package/dist/@types/base/services/modules/compras/ordemCompra/ItemOrdemCompraService.d.ts.map +1 -1
- package/dist/@types/base/services/modules/compras/ordemCompra/OrdemCompraService.d.ts +4 -0
- package/dist/@types/base/services/modules/compras/ordemCompra/OrdemCompraService.d.ts.map +1 -1
- package/dist/@types/base/utils/colorClassName/badge.d.ts.map +1 -1
- package/dist/base/assets/styles/init.css +54 -30
- package/dist/base/configs/endpoints.config/compras/config/itemOrdemCompra.js +4 -1
- package/dist/base/configs/endpoints.config/compras/config/itemOrdemCompra.js.map +1 -1
- package/dist/base/configs/endpoints.config/compras/config/ordemCompra.js +2 -1
- package/dist/base/configs/endpoints.config/compras/config/ordemCompra.js.map +1 -1
- package/dist/base/index.js +6 -2
- package/dist/base/services/index.js +6 -2
- package/dist/base/services/modules/compras/index.js +6 -2
- package/dist/base/services/modules/compras/ordemCompra/ItemOrdemCompraService.js +23 -1
- package/dist/base/services/modules/compras/ordemCompra/ItemOrdemCompraService.js.map +1 -1
- package/dist/base/services/modules/compras/ordemCompra/OrdemCompraService.js +8 -0
- package/dist/base/services/modules/compras/ordemCompra/OrdemCompraService.js.map +1 -1
- package/dist/base/services/modules/index.js +6 -2
- package/dist/base/utils/colorClassName/badge.js +2 -0
- package/dist/base/utils/colorClassName/badge.js.map +1 -1
- package/lib/@ecme/components/view/ChatBox/components/ChatInput.tsx +5 -4
- package/lib/@ecme/services/AiService.ts +31 -4
- package/lib/@ecme/views/concepts/ai/Chat/components/ChatView.tsx +43 -38
- package/lib/@ecme/views/concepts/ai/Chat/components/FormatoCard.tsx +123 -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 +12 -6
- package/lib/@ecme/views/concepts/ai/Chat/components/toolPresentation.ts +13 -0
- package/lib/@ecme/views/concepts/ai/Chat/hooks/useChatSend.ts +97 -60
- package/lib/@ecme/views/concepts/ai/Chat/hooks/useModelos.ts +63 -0
- package/lib/@ecme/views/concepts/ai/Chat/store/modeloStore.ts +25 -0
- package/lib/@ecme/views/concepts/ai/Chat/types.ts +96 -24
- package/lib/base/configs/endpoints.config/compras/config/itemOrdemCompra.ts +4 -1
- package/lib/base/configs/endpoints.config/compras/config/ordemCompra.ts +1 -0
- package/lib/base/services/modules/compras/ordemCompra/ItemOrdemCompraService.ts +22 -0
- package/lib/base/services/modules/compras/ordemCompra/OrdemCompraService.ts +8 -0
- package/lib/base/utils/colorClassName/badge.ts +2 -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
|
@@ -5593,6 +5593,9 @@ video {
|
|
|
5593
5593
|
.h-\[60px\]{
|
|
5594
5594
|
height: 60px;
|
|
5595
5595
|
}
|
|
5596
|
+
.h-\[70vh\]{
|
|
5597
|
+
height: 70vh;
|
|
5598
|
+
}
|
|
5596
5599
|
.h-\[calc\(100\%-100px\)\]{
|
|
5597
5600
|
height: calc(100% - 100px);
|
|
5598
5601
|
}
|
|
@@ -5659,9 +5662,15 @@ video {
|
|
|
5659
5662
|
.max-h-\[600px\]{
|
|
5660
5663
|
max-height: 600px;
|
|
5661
5664
|
}
|
|
5665
|
+
.max-h-\[60vh\]{
|
|
5666
|
+
max-height: 60vh;
|
|
5667
|
+
}
|
|
5662
5668
|
.max-h-\[700px\]{
|
|
5663
5669
|
max-height: 700px;
|
|
5664
5670
|
}
|
|
5671
|
+
.max-h-\[760px\]{
|
|
5672
|
+
max-height: 760px;
|
|
5673
|
+
}
|
|
5665
5674
|
.max-h-full{
|
|
5666
5675
|
max-height: 100%;
|
|
5667
5676
|
}
|
|
@@ -5704,6 +5713,9 @@ video {
|
|
|
5704
5713
|
.min-h-\[320px\]{
|
|
5705
5714
|
min-height: 320px;
|
|
5706
5715
|
}
|
|
5716
|
+
.min-h-\[360px\]{
|
|
5717
|
+
min-height: 360px;
|
|
5718
|
+
}
|
|
5707
5719
|
.min-h-\[46px\]{
|
|
5708
5720
|
min-height: 46px;
|
|
5709
5721
|
}
|
|
@@ -5920,6 +5932,9 @@ video {
|
|
|
5920
5932
|
.min-w-\[330px\]{
|
|
5921
5933
|
min-width: 330px;
|
|
5922
5934
|
}
|
|
5935
|
+
.min-w-\[6rem\]{
|
|
5936
|
+
min-width: 6rem;
|
|
5937
|
+
}
|
|
5923
5938
|
.min-w-full{
|
|
5924
5939
|
min-width: 100%;
|
|
5925
5940
|
}
|
|
@@ -5989,6 +6004,9 @@ video {
|
|
|
5989
6004
|
.max-w-\[900px\]{
|
|
5990
6005
|
max-width: 900px;
|
|
5991
6006
|
}
|
|
6007
|
+
.max-w-\[9rem\]{
|
|
6008
|
+
max-width: 9rem;
|
|
6009
|
+
}
|
|
5992
6010
|
.max-w-full{
|
|
5993
6011
|
max-width: 100%;
|
|
5994
6012
|
}
|
|
@@ -6440,10 +6458,6 @@ video {
|
|
|
6440
6458
|
.border-none{
|
|
6441
6459
|
border-style: none;
|
|
6442
6460
|
}
|
|
6443
|
-
.border-emerald-300{
|
|
6444
|
-
--tw-border-opacity: 1;
|
|
6445
|
-
border-color: rgb(110 231 183 / var(--tw-border-opacity, 1));
|
|
6446
|
-
}
|
|
6447
6461
|
.border-error{
|
|
6448
6462
|
border-color: var(--error);
|
|
6449
6463
|
}
|
|
@@ -6529,6 +6543,10 @@ video {
|
|
|
6529
6543
|
--tw-bg-opacity: 1;
|
|
6530
6544
|
background-color: rgb(251 191 36 / var(--tw-bg-opacity, 1));
|
|
6531
6545
|
}
|
|
6546
|
+
.bg-amber-50{
|
|
6547
|
+
--tw-bg-opacity: 1;
|
|
6548
|
+
background-color: rgb(255 251 235 / var(--tw-bg-opacity, 1));
|
|
6549
|
+
}
|
|
6532
6550
|
.bg-amber-500{
|
|
6533
6551
|
--tw-bg-opacity: 1;
|
|
6534
6552
|
background-color: rgb(245 158 11 / var(--tw-bg-opacity, 1));
|
|
@@ -6591,10 +6609,6 @@ video {
|
|
|
6591
6609
|
--tw-bg-opacity: 1;
|
|
6592
6610
|
background-color: rgb(167 243 208 / var(--tw-bg-opacity, 1));
|
|
6593
6611
|
}
|
|
6594
|
-
.bg-emerald-50{
|
|
6595
|
-
--tw-bg-opacity: 1;
|
|
6596
|
-
background-color: rgb(236 253 245 / var(--tw-bg-opacity, 1));
|
|
6597
|
-
}
|
|
6598
6612
|
.bg-emerald-500{
|
|
6599
6613
|
--tw-bg-opacity: 1;
|
|
6600
6614
|
background-color: rgb(16 185 129 / var(--tw-bg-opacity, 1));
|
|
@@ -7279,6 +7293,10 @@ video {
|
|
|
7279
7293
|
--tw-text-opacity: 1;
|
|
7280
7294
|
color: rgb(217 119 6 / var(--tw-text-opacity, 1));
|
|
7281
7295
|
}
|
|
7296
|
+
.text-amber-700{
|
|
7297
|
+
--tw-text-opacity: 1;
|
|
7298
|
+
color: rgb(180 83 9 / var(--tw-text-opacity, 1));
|
|
7299
|
+
}
|
|
7282
7300
|
.text-black{
|
|
7283
7301
|
--tw-text-opacity: 1;
|
|
7284
7302
|
color: rgb(0 0 0 / var(--tw-text-opacity, 1));
|
|
@@ -7303,10 +7321,6 @@ video {
|
|
|
7303
7321
|
--tw-text-opacity: 1;
|
|
7304
7322
|
color: rgb(5 150 105 / var(--tw-text-opacity, 1));
|
|
7305
7323
|
}
|
|
7306
|
-
.text-emerald-700{
|
|
7307
|
-
--tw-text-opacity: 1;
|
|
7308
|
-
color: rgb(4 120 87 / var(--tw-text-opacity, 1));
|
|
7309
|
-
}
|
|
7310
7324
|
.text-error{
|
|
7311
7325
|
color: var(--error);
|
|
7312
7326
|
}
|
|
@@ -7729,10 +7743,6 @@ video {
|
|
|
7729
7743
|
--tw-bg-opacity: 1;
|
|
7730
7744
|
background-color: rgb(37 99 235 / var(--tw-bg-opacity, 1));
|
|
7731
7745
|
}
|
|
7732
|
-
.hover\:bg-emerald-100:hover{
|
|
7733
|
-
--tw-bg-opacity: 1;
|
|
7734
|
-
background-color: rgb(209 250 229 / var(--tw-bg-opacity, 1));
|
|
7735
|
-
}
|
|
7736
7746
|
.hover\:bg-gray-100:hover{
|
|
7737
7747
|
background-color: var(--gray-100);
|
|
7738
7748
|
}
|
|
@@ -7882,6 +7892,24 @@ video {
|
|
|
7882
7892
|
.active\:bg-gray-100:active{
|
|
7883
7893
|
background-color: var(--gray-100);
|
|
7884
7894
|
}
|
|
7895
|
+
.enabled\:hover\:border-primary:hover:enabled{
|
|
7896
|
+
border-color: var(--primary);
|
|
7897
|
+
}
|
|
7898
|
+
.enabled\:hover\:bg-gray-50:hover:enabled{
|
|
7899
|
+
background-color: var(--gray-50);
|
|
7900
|
+
}
|
|
7901
|
+
.enabled\:hover\:text-primary:hover:enabled{
|
|
7902
|
+
color: var(--primary);
|
|
7903
|
+
}
|
|
7904
|
+
.disabled\:cursor-not-allowed:disabled{
|
|
7905
|
+
cursor: not-allowed;
|
|
7906
|
+
}
|
|
7907
|
+
.disabled\:opacity-40:disabled{
|
|
7908
|
+
opacity: 0.4;
|
|
7909
|
+
}
|
|
7910
|
+
.disabled\:opacity-60:disabled{
|
|
7911
|
+
opacity: 0.6;
|
|
7912
|
+
}
|
|
7885
7913
|
.group:hover .group-hover\:block{
|
|
7886
7914
|
display: block;
|
|
7887
7915
|
}
|
|
@@ -8009,10 +8037,6 @@ video {
|
|
|
8009
8037
|
.dark\:border-solid:is(.dark *){
|
|
8010
8038
|
border-style: solid;
|
|
8011
8039
|
}
|
|
8012
|
-
.dark\:border-emerald-700:is(.dark *){
|
|
8013
|
-
--tw-border-opacity: 1;
|
|
8014
|
-
border-color: rgb(4 120 87 / var(--tw-border-opacity, 1));
|
|
8015
|
-
}
|
|
8016
8040
|
.dark\:border-gray-500:is(.dark *){
|
|
8017
8041
|
border-color: var(--gray-500);
|
|
8018
8042
|
}
|
|
@@ -8082,9 +8106,6 @@ video {
|
|
|
8082
8106
|
.dark\:bg-emerald-500\/20:is(.dark *){
|
|
8083
8107
|
background-color: rgb(16 185 129 / 0.2);
|
|
8084
8108
|
}
|
|
8085
|
-
.dark\:bg-emerald-900\/30:is(.dark *){
|
|
8086
|
-
background-color: rgb(6 78 59 / 0.3);
|
|
8087
|
-
}
|
|
8088
8109
|
.dark\:bg-fuchsia-200:is(.dark *){
|
|
8089
8110
|
--tw-bg-opacity: 1;
|
|
8090
8111
|
background-color: rgb(245 208 254 / var(--tw-bg-opacity, 1));
|
|
@@ -8363,9 +8384,6 @@ video {
|
|
|
8363
8384
|
--tw-bg-opacity: 1;
|
|
8364
8385
|
background-color: rgb(0 0 0 / var(--tw-bg-opacity, 1));
|
|
8365
8386
|
}
|
|
8366
|
-
.dark\:hover\:bg-emerald-900\/50:hover:is(.dark *){
|
|
8367
|
-
background-color: rgb(6 78 59 / 0.5);
|
|
8368
|
-
}
|
|
8369
8387
|
.dark\:hover\:bg-gray-200:hover:is(.dark *){
|
|
8370
8388
|
background-color: var(--gray-200);
|
|
8371
8389
|
}
|
|
@@ -8424,6 +8442,9 @@ video {
|
|
|
8424
8442
|
.dark\:active\:bg-opacity-40:active:is(.dark *){
|
|
8425
8443
|
--tw-bg-opacity: 0.4;
|
|
8426
8444
|
}
|
|
8445
|
+
.dark\:enabled\:hover\:bg-gray-700:hover:enabled:is(.dark *){
|
|
8446
|
+
background-color: var(--gray-700);
|
|
8447
|
+
}
|
|
8427
8448
|
.group:hover .dark\:group-hover\:bg-gray-800:is(.dark *){
|
|
8428
8449
|
background-color: var(--gray-800);
|
|
8429
8450
|
}
|
|
@@ -1670,6 +1670,9 @@ video {
|
|
|
1670
1670
|
.h-\[60px\] {
|
|
1671
1671
|
height: 60px;
|
|
1672
1672
|
}
|
|
1673
|
+
.h-\[70vh\] {
|
|
1674
|
+
height: 70vh;
|
|
1675
|
+
}
|
|
1673
1676
|
.h-\[calc\(100\%-100px\)\] {
|
|
1674
1677
|
height: calc(100% - 100px);
|
|
1675
1678
|
}
|
|
@@ -1736,9 +1739,15 @@ video {
|
|
|
1736
1739
|
.max-h-\[600px\] {
|
|
1737
1740
|
max-height: 600px;
|
|
1738
1741
|
}
|
|
1742
|
+
.max-h-\[60vh\] {
|
|
1743
|
+
max-height: 60vh;
|
|
1744
|
+
}
|
|
1739
1745
|
.max-h-\[700px\] {
|
|
1740
1746
|
max-height: 700px;
|
|
1741
1747
|
}
|
|
1748
|
+
.max-h-\[760px\] {
|
|
1749
|
+
max-height: 760px;
|
|
1750
|
+
}
|
|
1742
1751
|
.max-h-full {
|
|
1743
1752
|
max-height: 100%;
|
|
1744
1753
|
}
|
|
@@ -1781,6 +1790,9 @@ video {
|
|
|
1781
1790
|
.min-h-\[320px\] {
|
|
1782
1791
|
min-height: 320px;
|
|
1783
1792
|
}
|
|
1793
|
+
.min-h-\[360px\] {
|
|
1794
|
+
min-height: 360px;
|
|
1795
|
+
}
|
|
1784
1796
|
.min-h-\[46px\] {
|
|
1785
1797
|
min-height: 46px;
|
|
1786
1798
|
}
|
|
@@ -1997,6 +2009,9 @@ video {
|
|
|
1997
2009
|
.min-w-\[330px\] {
|
|
1998
2010
|
min-width: 330px;
|
|
1999
2011
|
}
|
|
2012
|
+
.min-w-\[6rem\] {
|
|
2013
|
+
min-width: 6rem;
|
|
2014
|
+
}
|
|
2000
2015
|
.min-w-full {
|
|
2001
2016
|
min-width: 100%;
|
|
2002
2017
|
}
|
|
@@ -2066,6 +2081,9 @@ video {
|
|
|
2066
2081
|
.max-w-\[900px\] {
|
|
2067
2082
|
max-width: 900px;
|
|
2068
2083
|
}
|
|
2084
|
+
.max-w-\[9rem\] {
|
|
2085
|
+
max-width: 9rem;
|
|
2086
|
+
}
|
|
2069
2087
|
.max-w-full {
|
|
2070
2088
|
max-width: 100%;
|
|
2071
2089
|
}
|
|
@@ -2519,10 +2537,6 @@ video {
|
|
|
2519
2537
|
.border-none {
|
|
2520
2538
|
border-style: none;
|
|
2521
2539
|
}
|
|
2522
|
-
.border-emerald-300 {
|
|
2523
|
-
--tw-border-opacity: 1;
|
|
2524
|
-
border-color: rgb(110 231 183 / var(--tw-border-opacity, 1));
|
|
2525
|
-
}
|
|
2526
2540
|
.border-error {
|
|
2527
2541
|
border-color: var(--error);
|
|
2528
2542
|
}
|
|
@@ -2608,6 +2622,10 @@ video {
|
|
|
2608
2622
|
--tw-bg-opacity: 1;
|
|
2609
2623
|
background-color: rgb(251 191 36 / var(--tw-bg-opacity, 1));
|
|
2610
2624
|
}
|
|
2625
|
+
.bg-amber-50 {
|
|
2626
|
+
--tw-bg-opacity: 1;
|
|
2627
|
+
background-color: rgb(255 251 235 / var(--tw-bg-opacity, 1));
|
|
2628
|
+
}
|
|
2611
2629
|
.bg-amber-500 {
|
|
2612
2630
|
--tw-bg-opacity: 1;
|
|
2613
2631
|
background-color: rgb(245 158 11 / var(--tw-bg-opacity, 1));
|
|
@@ -2670,10 +2688,6 @@ video {
|
|
|
2670
2688
|
--tw-bg-opacity: 1;
|
|
2671
2689
|
background-color: rgb(167 243 208 / var(--tw-bg-opacity, 1));
|
|
2672
2690
|
}
|
|
2673
|
-
.bg-emerald-50 {
|
|
2674
|
-
--tw-bg-opacity: 1;
|
|
2675
|
-
background-color: rgb(236 253 245 / var(--tw-bg-opacity, 1));
|
|
2676
|
-
}
|
|
2677
2691
|
.bg-emerald-500 {
|
|
2678
2692
|
--tw-bg-opacity: 1;
|
|
2679
2693
|
background-color: rgb(16 185 129 / var(--tw-bg-opacity, 1));
|
|
@@ -3358,6 +3372,10 @@ video {
|
|
|
3358
3372
|
--tw-text-opacity: 1;
|
|
3359
3373
|
color: rgb(217 119 6 / var(--tw-text-opacity, 1));
|
|
3360
3374
|
}
|
|
3375
|
+
.text-amber-700 {
|
|
3376
|
+
--tw-text-opacity: 1;
|
|
3377
|
+
color: rgb(180 83 9 / var(--tw-text-opacity, 1));
|
|
3378
|
+
}
|
|
3361
3379
|
.text-black {
|
|
3362
3380
|
--tw-text-opacity: 1;
|
|
3363
3381
|
color: rgb(0 0 0 / var(--tw-text-opacity, 1));
|
|
@@ -3382,10 +3400,6 @@ video {
|
|
|
3382
3400
|
--tw-text-opacity: 1;
|
|
3383
3401
|
color: rgb(5 150 105 / var(--tw-text-opacity, 1));
|
|
3384
3402
|
}
|
|
3385
|
-
.text-emerald-700 {
|
|
3386
|
-
--tw-text-opacity: 1;
|
|
3387
|
-
color: rgb(4 120 87 / var(--tw-text-opacity, 1));
|
|
3388
|
-
}
|
|
3389
3403
|
.text-error {
|
|
3390
3404
|
color: var(--error);
|
|
3391
3405
|
}
|
|
@@ -3808,10 +3822,6 @@ video {
|
|
|
3808
3822
|
--tw-bg-opacity: 1;
|
|
3809
3823
|
background-color: rgb(37 99 235 / var(--tw-bg-opacity, 1));
|
|
3810
3824
|
}
|
|
3811
|
-
.hover\:bg-emerald-100:hover {
|
|
3812
|
-
--tw-bg-opacity: 1;
|
|
3813
|
-
background-color: rgb(209 250 229 / var(--tw-bg-opacity, 1));
|
|
3814
|
-
}
|
|
3815
3825
|
.hover\:bg-gray-100:hover {
|
|
3816
3826
|
background-color: var(--gray-100);
|
|
3817
3827
|
}
|
|
@@ -3961,6 +3971,24 @@ video {
|
|
|
3961
3971
|
.active\:bg-gray-100:active {
|
|
3962
3972
|
background-color: var(--gray-100);
|
|
3963
3973
|
}
|
|
3974
|
+
.enabled\:hover\:border-primary:hover:enabled {
|
|
3975
|
+
border-color: var(--primary);
|
|
3976
|
+
}
|
|
3977
|
+
.enabled\:hover\:bg-gray-50:hover:enabled {
|
|
3978
|
+
background-color: var(--gray-50);
|
|
3979
|
+
}
|
|
3980
|
+
.enabled\:hover\:text-primary:hover:enabled {
|
|
3981
|
+
color: var(--primary);
|
|
3982
|
+
}
|
|
3983
|
+
.disabled\:cursor-not-allowed:disabled {
|
|
3984
|
+
cursor: not-allowed;
|
|
3985
|
+
}
|
|
3986
|
+
.disabled\:opacity-40:disabled {
|
|
3987
|
+
opacity: 0.4;
|
|
3988
|
+
}
|
|
3989
|
+
.disabled\:opacity-60:disabled {
|
|
3990
|
+
opacity: 0.6;
|
|
3991
|
+
}
|
|
3964
3992
|
.group:hover .group-hover\:block {
|
|
3965
3993
|
display: block;
|
|
3966
3994
|
}
|
|
@@ -4106,10 +4134,6 @@ video {
|
|
|
4106
4134
|
.dark\:border-solid:is(.dark *) {
|
|
4107
4135
|
border-style: solid;
|
|
4108
4136
|
}
|
|
4109
|
-
.dark\:border-emerald-700:is(.dark *) {
|
|
4110
|
-
--tw-border-opacity: 1;
|
|
4111
|
-
border-color: rgb(4 120 87 / var(--tw-border-opacity, 1));
|
|
4112
|
-
}
|
|
4113
4137
|
.dark\:border-gray-500:is(.dark *) {
|
|
4114
4138
|
border-color: var(--gray-500);
|
|
4115
4139
|
}
|
|
@@ -4179,9 +4203,6 @@ video {
|
|
|
4179
4203
|
.dark\:bg-emerald-500\/20:is(.dark *) {
|
|
4180
4204
|
background-color: rgb(16 185 129 / 0.2);
|
|
4181
4205
|
}
|
|
4182
|
-
.dark\:bg-emerald-900\/30:is(.dark *) {
|
|
4183
|
-
background-color: rgb(6 78 59 / 0.3);
|
|
4184
|
-
}
|
|
4185
4206
|
.dark\:bg-fuchsia-200:is(.dark *) {
|
|
4186
4207
|
--tw-bg-opacity: 1;
|
|
4187
4208
|
background-color: rgb(245 208 254 / var(--tw-bg-opacity, 1));
|
|
@@ -4460,9 +4481,6 @@ video {
|
|
|
4460
4481
|
--tw-bg-opacity: 1;
|
|
4461
4482
|
background-color: rgb(0 0 0 / var(--tw-bg-opacity, 1));
|
|
4462
4483
|
}
|
|
4463
|
-
.dark\:hover\:bg-emerald-900\/50:hover:is(.dark *) {
|
|
4464
|
-
background-color: rgb(6 78 59 / 0.5);
|
|
4465
|
-
}
|
|
4466
4484
|
.dark\:hover\:bg-gray-200:hover:is(.dark *) {
|
|
4467
4485
|
background-color: var(--gray-200);
|
|
4468
4486
|
}
|
|
@@ -4521,6 +4539,9 @@ video {
|
|
|
4521
4539
|
.dark\:active\:bg-opacity-40:active:is(.dark *) {
|
|
4522
4540
|
--tw-bg-opacity: 0.4;
|
|
4523
4541
|
}
|
|
4542
|
+
.dark\:enabled\:hover\:bg-gray-700:hover:enabled:is(.dark *) {
|
|
4543
|
+
background-color: var(--gray-700);
|
|
4544
|
+
}
|
|
4524
4545
|
.group:hover .dark\:group-hover\:bg-gray-800:is(.dark *) {
|
|
4525
4546
|
background-color: var(--gray-800);
|
|
4526
4547
|
}
|
|
@@ -3,7 +3,7 @@ import Container from "../shared/Container.js";
|
|
|
3
3
|
import classNames from "../../utils/classNames.js";
|
|
4
4
|
import { APP_NAME } from "../../constants/app.constant.js";
|
|
5
5
|
import { PAGE_CONTAINER_GUTTER_X } from "../../constants/theme.constant.js";
|
|
6
|
-
const version = true ? "5.6.
|
|
6
|
+
const version = true ? "5.6.341" : "0.0.0";
|
|
7
7
|
const FooterContent = () => {
|
|
8
8
|
return /* @__PURE__ */ jsxs("div", { className: "flex w-full flex-auto items-center justify-between", children: [
|
|
9
9
|
/* @__PURE__ */ jsxs("span", { children: [
|
|
@@ -58,8 +58,9 @@ const ChatInput = (props) => {
|
|
|
58
58
|
children: /* @__PURE__ */ jsx(
|
|
59
59
|
"button",
|
|
60
60
|
{
|
|
61
|
-
className: "text-xl heading-text hover:text-primary px-1 py-2",
|
|
61
|
+
className: "text-xl heading-text enabled:hover:text-primary disabled:cursor-not-allowed disabled:opacity-40 px-1 py-2",
|
|
62
62
|
type: "button",
|
|
63
|
+
disabled: uploadProps?.disabled,
|
|
63
64
|
children: /* @__PURE__ */ jsx(TbPhotoPlus, {})
|
|
64
65
|
}
|
|
65
66
|
)
|
|
@@ -69,7 +70,7 @@ const ChatInput = (props) => {
|
|
|
69
70
|
"input",
|
|
70
71
|
{
|
|
71
72
|
ref: useMergeRef(inputRef, ref),
|
|
72
|
-
className: "flex-1 h-full placeholder:text-gray-400 bg-transparent focus:outline-none heading-text",
|
|
73
|
+
className: "flex-1 min-w-[6rem] h-full placeholder:text-gray-400 bg-transparent focus:outline-none heading-text",
|
|
73
74
|
placeholder,
|
|
74
75
|
onKeyDown: handleKeyDown
|
|
75
76
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatInput.js","sources":["../../../../../../lib/@ecme/components/view/ChatBox/components/ChatInput.tsx"],"sourcesContent":["import { useState, useRef } from 'react'\nimport Button from '@/components/ui/Button'\nimport Upload from '@/components/ui/Upload'\nimport hooks from '@/components/ui/hooks'\nimport { TbPhotoPlus, TbArrowRight } from 'react-icons/tb'\nimport type { UploadProps } from '@/components/ui/Upload'\nimport type { KeyboardEvent, ReactNode, Ref } from 'react'\n\nexport type ChatInputProps = {\n placeholder?: string\n onInputChange?: (payload: { value: string; attachments: File[] }) => void\n ref?: Ref<HTMLInputElement>\n /** Controles extras dentro da caixa, logo antes do botão de enviar. */\n inputActions?: ReactNode\n /** Restrições do seletor de anexos (tipos aceitos e
|
|
1
|
+
{"version":3,"file":"ChatInput.js","sources":["../../../../../../lib/@ecme/components/view/ChatBox/components/ChatInput.tsx"],"sourcesContent":["import { useState, useRef } from 'react'\nimport Button from '@/components/ui/Button'\nimport Upload from '@/components/ui/Upload'\nimport hooks from '@/components/ui/hooks'\nimport { TbPhotoPlus, TbArrowRight } from 'react-icons/tb'\nimport type { UploadProps } from '@/components/ui/Upload'\nimport type { KeyboardEvent, ReactNode, Ref } from 'react'\n\nexport type ChatInputProps = {\n placeholder?: string\n onInputChange?: (payload: { value: string; attachments: File[] }) => void\n ref?: Ref<HTMLInputElement>\n /** Controles extras dentro da caixa, logo antes do botão de enviar. */\n inputActions?: ReactNode\n /** Restrições do seletor de anexos (tipos aceitos, validação e bloqueio). */\n uploadProps?: Pick<UploadProps, 'accept' | 'beforeUpload' | 'disabled'>\n}\n\nconst { useMergeRef } = hooks\n\nconst ChatInput = (props: ChatInputProps) => {\n const [attachments, setAttachments] = useState<File[]>([])\n\n const {\n placeholder,\n onInputChange,\n ref = null,\n inputActions,\n uploadProps,\n } = props\n\n const inputRef = useRef<HTMLInputElement>(null)\n\n const handleInputClear = () => {\n if (inputRef.current) {\n inputRef.current.value = ''\n }\n setAttachments([])\n }\n\n /** Envia texto, anexos ou os dois; com a caixa vazia não faz nada. */\n const enviar = () => {\n const value = inputRef.current?.value ?? ''\n if (!value.trim() && attachments.length === 0) {\n return\n }\n onInputChange?.({ value, attachments })\n handleInputClear()\n }\n\n const handleKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Enter') {\n enviar()\n }\n }\n\n return (\n <div className=\"border-2 border-gray-200 dark:border-gray-700 rounded-xl min-h-[50px] px-3 flex flex-col\">\n {attachments.length > 0 && (\n <Upload\n fileList={attachments}\n fileListClass=\"flex gap-4\"\n fileItemClass=\"flex gap-8\"\n onFileRemove={setAttachments}\n >\n <></>\n </Upload>\n )}\n <div className=\"flex items-center gap-2 w-full h-[50px]\">\n <Upload\n {...uploadProps}\n fileList={attachments}\n showList={false}\n onChange={setAttachments}\n >\n <button\n className=\"text-xl heading-text enabled:hover:text-primary disabled:cursor-not-allowed disabled:opacity-40 px-1 py-2\"\n type=\"button\"\n disabled={uploadProps?.disabled}\n >\n <TbPhotoPlus />\n </button>\n </Upload>\n <input\n ref={useMergeRef(inputRef, ref)}\n className=\"flex-1 min-w-[6rem] h-full placeholder:text-gray-400 bg-transparent focus:outline-none heading-text\"\n placeholder={placeholder}\n onKeyDown={handleKeyDown}\n />\n {inputActions}\n <Button\n size=\"xs\"\n shape=\"circle\"\n variant=\"solid\"\n icon={<TbArrowRight />}\n onClick={enviar}\n />\n </div>\n </div>\n )\n}\n\nexport default ChatInput\n"],"names":[],"mappings":";;;;;;;;AAkBA,MAAM,EAAE,gBAAgB;AAExB,MAAM,YAAY,CAAC,UAA0B;AACzC,QAAM,CAAC,aAAa,cAAc,IAAI,SAAiB,CAAA,CAAE;AAEzD,QAAM;AAAA,IACF;AAAA,IACA;AAAA,IACA,MAAM;AAAA,IACN;AAAA,IACA;AAAA,EAAA,IACA;AAEJ,QAAM,WAAW,OAAyB,IAAI;AAE9C,QAAM,mBAAmB,MAAM;AAC3B,QAAI,SAAS,SAAS;AAClB,eAAS,QAAQ,QAAQ;AAAA,IAC7B;AACA,mBAAe,CAAA,CAAE;AAAA,EACrB;AAGA,QAAM,SAAS,MAAM;AACjB,UAAM,QAAQ,SAAS,SAAS,SAAS;AACzC,QAAI,CAAC,MAAM,KAAA,KAAU,YAAY,WAAW,GAAG;AAC3C;AAAA,IACJ;AACA,oBAAgB,EAAE,OAAO,aAAa;AACtC,qBAAA;AAAA,EACJ;AAEA,QAAM,gBAAgB,CAAC,UAA2C;AAC9D,QAAI,MAAM,QAAQ,SAAS;AACvB,aAAA;AAAA,IACJ;AAAA,EACJ;AAEA,SACI,qBAAC,OAAA,EAAI,WAAU,4FACV,UAAA;AAAA,IAAA,YAAY,SAAS,KAClB;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,UAAU;AAAA,QACV,eAAc;AAAA,QACd,eAAc;AAAA,QACd,cAAc;AAAA,QAEd,UAAA,oBAAA,UAAA,CAAA,CAAE;AAAA,MAAA;AAAA,IAAA;AAAA,IAGV,qBAAC,OAAA,EAAI,WAAU,2CACX,UAAA;AAAA,MAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACI,GAAG;AAAA,UACJ,UAAU;AAAA,UACV,UAAU;AAAA,UACV,UAAU;AAAA,UAEV,UAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACG,WAAU;AAAA,cACV,MAAK;AAAA,cACL,UAAU,aAAa;AAAA,cAEvB,8BAAC,aAAA,CAAA,CAAY;AAAA,YAAA;AAAA,UAAA;AAAA,QACjB;AAAA,MAAA;AAAA,MAEJ;AAAA,QAAC;AAAA,QAAA;AAAA,UACG,KAAK,YAAY,UAAU,GAAG;AAAA,UAC9B,WAAU;AAAA,UACV;AAAA,UACA,WAAW;AAAA,QAAA;AAAA,MAAA;AAAA,MAEd;AAAA,MACD;AAAA,QAAC;AAAA,QAAA;AAAA,UACG,MAAK;AAAA,UACL,OAAM;AAAA,UACN,SAAQ;AAAA,UACR,0BAAO,cAAA,EAAa;AAAA,UACpB,SAAS;AAAA,QAAA;AAAA,MAAA;AAAA,IACb,EAAA,CACJ;AAAA,EAAA,GACJ;AAER;"}
|
package/dist/@ecme/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import "./auth/index.js";
|
|
|
10
10
|
import "./assets/index.js";
|
|
11
11
|
import "./locales/index.js";
|
|
12
12
|
import { ADMIN, USER } from "./constants/roles.constant.js";
|
|
13
|
-
import { AI_API_URL, apiDeleteConversation, apiGetChatHistory, apiGetConversations, apiGetImagemDoChat, apiGetImages, apiPostImages, apiRenameConversation, resumeChat, streamChat } from "./services/AiService.js";
|
|
13
|
+
import { AI_API_URL, apiDeleteConversation, apiGetChatHistory, apiGetConversations, apiGetImagemDoChat, apiGetImages, apiGetModelos, apiPostImages, apiRenameConversation, resumeChat, streamChat } from "./services/AiService.js";
|
|
14
14
|
import { APP_NAME, REDIRECT_URL_KEY } from "./constants/app.constant.js";
|
|
15
15
|
import { AUTH_PREFIX_PATH, CONCEPTS_PREFIX_PATH, DASHBOARDS_PREFIX_PATH, GUIDE_PREFIX_PATH, PAGES_PREFIX_PATH, ROOT, UI_COMPONENTS_PREFIX_PATH } from "./constants/route.constant.js";
|
|
16
16
|
import { default as default2 } from "./components/shared/AbbreviateNumber.js";
|
|
@@ -400,6 +400,7 @@ export {
|
|
|
400
400
|
apiGetMail,
|
|
401
401
|
apiGetMails,
|
|
402
402
|
apiGetMarketingDashboard,
|
|
403
|
+
apiGetModelos,
|
|
403
404
|
apiGetNotificationCount,
|
|
404
405
|
apiGetNotificationList,
|
|
405
406
|
apiGetOrder,
|
|
@@ -48,17 +48,24 @@ async function apiDeleteConversation(conversationId) {
|
|
|
48
48
|
method: "delete"
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
|
+
async function apiGetModelos() {
|
|
52
|
+
return aiRequest({
|
|
53
|
+
url: "/ai/chat/models",
|
|
54
|
+
method: "get"
|
|
55
|
+
});
|
|
56
|
+
}
|
|
51
57
|
async function streamChat({
|
|
52
58
|
prompt,
|
|
53
59
|
conversationId,
|
|
54
60
|
esforco,
|
|
61
|
+
modelo,
|
|
55
62
|
imagens,
|
|
56
63
|
signal,
|
|
57
64
|
onEvent
|
|
58
65
|
}) {
|
|
59
66
|
await postarEConsumir(
|
|
60
67
|
"/ai/chat/stream",
|
|
61
|
-
{ prompt, conversation_id: conversationId, esforco, imagens },
|
|
68
|
+
{ prompt, conversation_id: conversationId, esforco, modelo, imagens },
|
|
62
69
|
onEvent,
|
|
63
70
|
signal
|
|
64
71
|
);
|
|
@@ -74,14 +81,23 @@ async function apiGetImagemDoChat(objectName) {
|
|
|
74
81
|
async function resumeChat({
|
|
75
82
|
approved,
|
|
76
83
|
dados,
|
|
84
|
+
formato,
|
|
77
85
|
conversationId,
|
|
78
86
|
esforco,
|
|
87
|
+
modelo,
|
|
79
88
|
signal,
|
|
80
89
|
onEvent
|
|
81
90
|
}) {
|
|
82
91
|
await postarEConsumir(
|
|
83
92
|
"/ai/chat/resume",
|
|
84
|
-
{
|
|
93
|
+
{
|
|
94
|
+
approved,
|
|
95
|
+
dados,
|
|
96
|
+
formato,
|
|
97
|
+
conversation_id: conversationId,
|
|
98
|
+
esforco,
|
|
99
|
+
modelo
|
|
100
|
+
},
|
|
85
101
|
onEvent,
|
|
86
102
|
signal
|
|
87
103
|
);
|
|
@@ -128,6 +144,7 @@ export {
|
|
|
128
144
|
apiGetConversations,
|
|
129
145
|
apiGetImagemDoChat,
|
|
130
146
|
apiGetImages,
|
|
147
|
+
apiGetModelos,
|
|
131
148
|
apiPostImages,
|
|
132
149
|
apiRenameConversation,
|
|
133
150
|
resumeChat,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AiService.js","sources":["../../../lib/@ecme/services/AiService.ts"],"sourcesContent":["import { endpointsConfig } from '@base/configs'\nimport { authHeaders } from './aiAuthHeaders'\nimport ApiService from './ApiService'\nimport { readSse } from './sseParser'\nimport type {\n ArquivoDoStorage,\n ChatEvent,\n Esforco,\n ImagemEnviada,\n} from '@/views/concepts/ai/Chat/types'\nimport type { AxiosRequestConfig } from 'axios'\n\nconst AI_DEV_URL = 'http://localhost:8000'\nconst AI_QAS_URL = 'https://orbe-ai.apps.qas.orbeagro.com.br'\nconst AI_PRD_URL = 'https://orbe-ai.apps.prd.orbeagro.com.br'\n\n/**\n * Host da API de IA.\n *\n * O /ai/* nao vive no gateway do resto da aplicacao, entao nao pode usar o\n * baseURL do AxiosBase (API_URL). A resolucao e por origin em runtime, e nao\n * por import.meta.env.MODE, porque o MODE e congelado na build da lib como\n * \"production\" e nao reflete o dev do MFE consumidor.\n */\nfunction getAiApiUrl() {\n const origin = globalThis?.location?.origin ?? ''\n\n if (origin.includes('localhost') || origin.includes('127.0.0.1')) {\n return AI_DEV_URL\n }\n\n if (origin.includes('.prd.')) {\n return AI_PRD_URL\n }\n\n return AI_QAS_URL\n}\n\nexport const AI_API_URL = getAiApiUrl()\n\n/**\n * Toda chamada de IA sai pelo AI_API_URL (o baseURL por requisicao vence o da\n * instancia do AxiosBase) e fica fora do loading global — o chat mostra o\n * proprio balaozinho de \"digitando\".\n */\nconst aiRequest = <T>(config: AxiosRequestConfig) =>\n ApiService.fetchDataWithAxios<T>({\n ...config,\n baseURL: AI_API_URL,\n skipGlobalLoading: true,\n })\n\nexport async function apiGetChatHistory<T>(conversationId?: string) {\n return aiRequest<T>({\n url: '/ai/chat/history',\n method: 'get',\n params: conversationId ? { conversation_id: conversationId } : undefined,\n })\n}\n\n/** Conversas do usuário (só o resumo), a mais recente primeiro. */\nexport async function apiGetConversations<T>() {\n return aiRequest<T>({\n url: '/ai/chat/conversations',\n method: 'get',\n })\n}\n\nexport async function apiRenameConversation(conversationId: string, title: string) {\n return aiRequest<void>({\n url: `/ai/chat/conversations/${encodeURIComponent(conversationId)}`,\n method: 'patch',\n data: { title },\n })\n}\n\n/** Apaga a conversa e toda a memória dela no backend. */\nexport async function apiDeleteConversation(conversationId: string) {\n return aiRequest<void>({\n url: `/ai/chat/conversations/${encodeURIComponent(conversationId)}`,\n method: 'delete',\n })\n}\n\nexport type StreamChatParams = {\n prompt: string\n /** Identifica a conversa; o backend usa como thread da memoria. */\n conversationId?: string\n /** Nivel de raciocinio desta mensagem; ausente = o padrao do backend. */\n esforco?: Esforco\n /** Imagens desta mensagem; ausente = so texto. */\n imagens?: ImagemEnviada[]\n signal?: AbortSignal\n onEvent: (evento: ChatEvent) => void\n}\n\n/**\n * Resposta a pausa atual do agente. Ha
|
|
1
|
+
{"version":3,"file":"AiService.js","sources":["../../../lib/@ecme/services/AiService.ts"],"sourcesContent":["import { endpointsConfig } from '@base/configs'\nimport { authHeaders } from './aiAuthHeaders'\nimport ApiService from './ApiService'\nimport { readSse } from './sseParser'\nimport type {\n ArquivoDoStorage,\n ChatEvent,\n Esforco,\n FormatoDoRelatorio,\n ImagemEnviada,\n} from '@/views/concepts/ai/Chat/types'\nimport type { AxiosRequestConfig } from 'axios'\n\nconst AI_DEV_URL = 'http://localhost:8000'\nconst AI_QAS_URL = 'https://orbe-ai.apps.qas.orbeagro.com.br'\nconst AI_PRD_URL = 'https://orbe-ai.apps.prd.orbeagro.com.br'\n\n/**\n * Host da API de IA.\n *\n * O /ai/* nao vive no gateway do resto da aplicacao, entao nao pode usar o\n * baseURL do AxiosBase (API_URL). A resolucao e por origin em runtime, e nao\n * por import.meta.env.MODE, porque o MODE e congelado na build da lib como\n * \"production\" e nao reflete o dev do MFE consumidor.\n */\nfunction getAiApiUrl() {\n const origin = globalThis?.location?.origin ?? ''\n\n if (origin.includes('localhost') || origin.includes('127.0.0.1')) {\n return AI_DEV_URL\n }\n\n if (origin.includes('.prd.')) {\n return AI_PRD_URL\n }\n\n return AI_QAS_URL\n}\n\nexport const AI_API_URL = getAiApiUrl()\n\n/**\n * Toda chamada de IA sai pelo AI_API_URL (o baseURL por requisicao vence o da\n * instancia do AxiosBase) e fica fora do loading global — o chat mostra o\n * proprio balaozinho de \"digitando\".\n */\nconst aiRequest = <T>(config: AxiosRequestConfig) =>\n ApiService.fetchDataWithAxios<T>({\n ...config,\n baseURL: AI_API_URL,\n skipGlobalLoading: true,\n })\n\nexport async function apiGetChatHistory<T>(conversationId?: string) {\n return aiRequest<T>({\n url: '/ai/chat/history',\n method: 'get',\n params: conversationId ? { conversation_id: conversationId } : undefined,\n })\n}\n\n/** Conversas do usuário (só o resumo), a mais recente primeiro. */\nexport async function apiGetConversations<T>() {\n return aiRequest<T>({\n url: '/ai/chat/conversations',\n method: 'get',\n })\n}\n\nexport async function apiRenameConversation(conversationId: string, title: string) {\n return aiRequest<void>({\n url: `/ai/chat/conversations/${encodeURIComponent(conversationId)}`,\n method: 'patch',\n data: { title },\n })\n}\n\n/** Apaga a conversa e toda a memória dela no backend. */\nexport async function apiDeleteConversation(conversationId: string) {\n return aiRequest<void>({\n url: `/ai/chat/conversations/${encodeURIComponent(conversationId)}`,\n method: 'delete',\n })\n}\n\n/** Modelos que o chat oferece e o padrão; a lista vem do .env do backend. */\nexport async function apiGetModelos<T>() {\n return aiRequest<T>({\n url: '/ai/chat/models',\n method: 'get',\n })\n}\n\nexport type StreamChatParams = {\n prompt: string\n /** Identifica a conversa; o backend usa como thread da memoria. */\n conversationId?: string\n /** Nivel de raciocinio desta mensagem; ausente = o padrao do backend. */\n esforco?: Esforco\n /** Modelo desta mensagem, da lista do backend; ausente = o padrao. */\n modelo?: string\n /** Imagens desta mensagem; ausente = so texto. */\n imagens?: ImagemEnviada[]\n signal?: AbortSignal\n onEvent: (evento: ChatEvent) => void\n}\n\n/**\n * Resposta a pausa atual do agente. Ha tres, e um endpoint so:\n * - `approved` responde ao `approval_required` (true aprova, false nega).\n * - `dados` responde ao `input_required`; `null` = o usuario fechou o\n * formulario sem preencher.\n * - `formato` responde ao `format_required`; `null` = o usuario fechou a\n * escolha sem escolher.\n */\nexport type ResumeChatParams = {\n approved?: boolean\n dados?: Record<string, unknown> | null\n formato?: FormatoDoRelatorio | null\n conversationId?: string\n /** A retomada tambem chama o modelo: vale o mesmo nivel do envio. */\n esforco?: Esforco\n /** E o mesmo modelo do envio. */\n modelo?: string\n signal?: AbortSignal\n onEvent: (evento: ChatEvent) => void\n}\n\n/**\n * Envia a mensagem e consome a resposta em streaming (SSE).\n *\n * Usa `fetch`, e nao o Axios, porque o Axios no browser so resolve a Promise\n * com a resposta inteira — nao ha como ler o corpo enquanto ele chega.\n */\nexport async function streamChat({\n prompt,\n conversationId,\n esforco,\n modelo,\n imagens,\n signal,\n onEvent,\n}: StreamChatParams): Promise<void> {\n await postarEConsumir(\n '/ai/chat/stream',\n { prompt, conversation_id: conversationId, esforco, modelo, imagens },\n onEvent,\n signal,\n )\n}\n\n/**\n * Imagem do chat guardada no object storage, pelo `objectName` do historico.\n *\n * Vai pelo gateway, como os outros modulos (e nao pelo AI_API_URL): e o mesmo\n * endpoint do `ObjectStorageService`, mas fora do loading global - a miniatura\n * carrega dentro da mensagem, sem travar a tela.\n */\nexport async function apiGetImagemDoChat(objectName: string) {\n return ApiService.fetchDataWithAxios<ArquivoDoStorage>({\n url: endpointsConfig.objectStorage.minio.download,\n method: 'get',\n params: { fileName: objectName },\n skipGlobalLoading: true,\n })\n}\n\n/**\n * Retoma uma conversa parada numa pausa (aprovacao, coleta de dados ou escolha\n * do formato do relatorio).\n *\n * Devolve o mesmo tipo de stream do `streamChat`, e a resposta continua na\n * MESMA mensagem do chat — o backend so volta do ponto onde parou.\n *\n * O `JSON.stringify` descarta chaves `undefined`, entao o backend recebe apenas\n * o campo da pausa que esta sendo respondida.\n */\nexport async function resumeChat({\n approved,\n dados,\n formato,\n conversationId,\n esforco,\n modelo,\n signal,\n onEvent,\n}: ResumeChatParams): Promise<void> {\n await postarEConsumir(\n '/ai/chat/resume',\n {\n approved,\n dados,\n formato,\n conversation_id: conversationId,\n esforco,\n modelo,\n },\n onEvent,\n signal,\n )\n}\n\n/** POST + leitura do SSE, comum ao envio e a retomada. */\nasync function postarEConsumir(\n caminho: string,\n corpo: Record<string, unknown>,\n onEvent: (evento: ChatEvent) => void,\n signal?: AbortSignal,\n): Promise<void> {\n const resposta = await fetch(`${AI_API_URL}${caminho}`, {\n method: 'POST',\n headers: {\n ...authHeaders(),\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(corpo),\n signal,\n })\n\n if (!resposta.ok || !resposta.body) {\n throw new Error(`Falha ao falar com a IA (HTTP ${resposta.status})`)\n }\n\n await readSse(resposta.body, ({ event, data }) => {\n try {\n onEvent({ type: event, data: JSON.parse(data) } as ChatEvent)\n } catch (error) {\n // Evento malformado nao pode derrubar o stream inteiro.\n console.debug('Evento SSE ignorado:', event, error)\n }\n })\n}\n\nexport async function apiGetImages<T, U extends Record<string, unknown>>(\n params: U,\n) {\n return aiRequest<T>({\n url: '/ai/images',\n method: 'get',\n params,\n })\n}\n\nexport async function apiPostImages<T, U extends Record<string, unknown>>(\n data: U,\n) {\n return aiRequest<T>({\n url: '/ai/images',\n method: 'post',\n data,\n })\n}\n"],"names":["endpointsConfig"],"mappings":"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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as default2 } from "./ApiService.js";
|
|
2
2
|
import { apiGetPricingPlans, apiGetRolesPermissionsRoles, apiGetRolesPermissionsUsers, apiGetSettingsBilling, apiGetSettingsIntergration, apiGetSettingsNotification, apiGetSettingsProfile } from "./AccontsService.js";
|
|
3
|
-
import { AI_API_URL, apiDeleteConversation, apiGetChatHistory, apiGetConversations, apiGetImagemDoChat, apiGetImages, apiPostImages, apiRenameConversation, resumeChat, streamChat } from "./AiService.js";
|
|
3
|
+
import { AI_API_URL, apiDeleteConversation, apiGetChatHistory, apiGetConversations, apiGetImagemDoChat, apiGetImages, apiGetModelos, apiPostImages, apiRenameConversation, resumeChat, streamChat } from "./AiService.js";
|
|
4
4
|
import { apiForgotPassword, apiResetPassword, apiSignIn, apiSignOut, apiSignUp } from "./AuthService.js";
|
|
5
5
|
import { apiGetCalendar } from "./CalendarService.js";
|
|
6
6
|
import { apiGetChats, apiGetContactDetails, apiGetContacts, apiGetConversation } from "./ChatService.js";
|
|
@@ -40,6 +40,7 @@ export {
|
|
|
40
40
|
apiGetMail,
|
|
41
41
|
apiGetMails,
|
|
42
42
|
apiGetMarketingDashboard,
|
|
43
|
+
apiGetModelos,
|
|
43
44
|
apiGetNotificationCount,
|
|
44
45
|
apiGetNotificationList,
|
|
45
46
|
apiGetOrder,
|