@greatapps/greatagents-ui 0.3.1 → 0.3.3
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/index.js +123 -50
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/agents/agent-edit-form.tsx +4 -1
- package/src/components/agents/agent-form-dialog.tsx +5 -1
- package/src/components/agents/agent-objectives-list.tsx +15 -6
- package/src/components/agents/agent-prompt-editor.tsx +9 -5
- package/src/components/agents/agent-tabs.tsx +4 -4
- package/src/components/agents/agent-tools-list.tsx +12 -5
- package/src/components/agents/agents-table.tsx +7 -2
- package/src/components/conversations/agent-conversations-table.tsx +13 -2
- package/src/components/conversations/conversation-view.tsx +2 -2
- package/src/components/tools/tool-credentials-form.tsx +34 -14
- package/src/components/tools/tool-form-dialog.tsx +9 -5
- package/src/components/tools/tools-table.tsx +8 -3
- package/src/pages/agent-detail-page.tsx +2 -1
package/dist/index.js
CHANGED
|
@@ -504,6 +504,7 @@ function useColumns(onEdit, onDelete) {
|
|
|
504
504
|
variant: "ghost",
|
|
505
505
|
size: "icon",
|
|
506
506
|
className: "h-8 w-8",
|
|
507
|
+
"aria-label": "Editar",
|
|
507
508
|
onClick: () => onEdit(row.original),
|
|
508
509
|
children: /* @__PURE__ */ jsx(Pencil, { className: "h-4 w-4" })
|
|
509
510
|
}
|
|
@@ -517,6 +518,7 @@ function useColumns(onEdit, onDelete) {
|
|
|
517
518
|
variant: "ghost",
|
|
518
519
|
size: "icon",
|
|
519
520
|
className: "h-8 w-8 text-destructive hover:text-destructive",
|
|
521
|
+
"aria-label": "Excluir",
|
|
520
522
|
onClick: () => onDelete(row.original.id),
|
|
521
523
|
children: /* @__PURE__ */ jsx(Trash2, { className: "h-4 w-4" })
|
|
522
524
|
}
|
|
@@ -565,11 +567,14 @@ function AgentsTable({ config, onNavigateToAgent }) {
|
|
|
565
567
|
}
|
|
566
568
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
567
569
|
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ jsxs("div", { className: "relative flex-1 max-w-md", children: [
|
|
568
|
-
/* @__PURE__ */ jsx(Search, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
570
|
+
/* @__PURE__ */ jsx(Search, { "aria-hidden": "true", className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
569
571
|
/* @__PURE__ */ jsx(
|
|
570
572
|
Input,
|
|
571
573
|
{
|
|
572
|
-
placeholder: "Buscar agentes
|
|
574
|
+
placeholder: "Buscar agentes\\u2026",
|
|
575
|
+
"aria-label": "Buscar agentes",
|
|
576
|
+
name: "search",
|
|
577
|
+
autoComplete: "off",
|
|
573
578
|
value: search,
|
|
574
579
|
onChange: (e) => handleSearchChange(e.target.value),
|
|
575
580
|
className: "pl-9"
|
|
@@ -693,6 +698,7 @@ function AgentFormDialog({
|
|
|
693
698
|
Input2,
|
|
694
699
|
{
|
|
695
700
|
id: "agent-photo",
|
|
701
|
+
name: "photo",
|
|
696
702
|
value: photo,
|
|
697
703
|
onChange: (e) => setPhoto(e.target.value),
|
|
698
704
|
placeholder: "https://exemplo.com/foto.jpg",
|
|
@@ -706,6 +712,7 @@ function AgentFormDialog({
|
|
|
706
712
|
Input2,
|
|
707
713
|
{
|
|
708
714
|
id: "agent-title",
|
|
715
|
+
name: "title",
|
|
709
716
|
value: title,
|
|
710
717
|
onChange: (e) => setTitle(e.target.value),
|
|
711
718
|
placeholder: "Ex: Assistente de Agendamento",
|
|
@@ -721,6 +728,7 @@ function AgentFormDialog({
|
|
|
721
728
|
Input2,
|
|
722
729
|
{
|
|
723
730
|
id: "agent-delay",
|
|
731
|
+
name: "delay",
|
|
724
732
|
type: "number",
|
|
725
733
|
value: delayTyping,
|
|
726
734
|
onChange: (e) => setDelayTyping(e.target.value),
|
|
@@ -736,6 +744,7 @@ function AgentFormDialog({
|
|
|
736
744
|
Input2,
|
|
737
745
|
{
|
|
738
746
|
id: "agent-waiting",
|
|
747
|
+
name: "waiting",
|
|
739
748
|
type: "number",
|
|
740
749
|
value: waitingTime,
|
|
741
750
|
onChange: (e) => setWaitingTime(e.target.value),
|
|
@@ -758,7 +767,7 @@ function AgentFormDialog({
|
|
|
758
767
|
}
|
|
759
768
|
),
|
|
760
769
|
/* @__PURE__ */ jsxs2(Button2, { type: "submit", disabled: isPending || !title.trim(), children: [
|
|
761
|
-
isPending ? /* @__PURE__ */ jsx2(Loader2, { className: "mr-2 h-4 w-4 animate-spin" }) : null,
|
|
770
|
+
isPending ? /* @__PURE__ */ jsx2(Loader2, { "aria-hidden": "true", className: "mr-2 h-4 w-4 animate-spin" }) : null,
|
|
762
771
|
isEditing ? "Salvar" : "Criar"
|
|
763
772
|
] })
|
|
764
773
|
] })
|
|
@@ -857,6 +866,7 @@ function AgentEditForm({ config, agent, idAccount, open, onOpenChange }) {
|
|
|
857
866
|
Input3,
|
|
858
867
|
{
|
|
859
868
|
id: "edit-title",
|
|
869
|
+
name: "title",
|
|
860
870
|
value: form.title,
|
|
861
871
|
onChange: (e) => {
|
|
862
872
|
setForm((prev) => ({
|
|
@@ -890,6 +900,7 @@ function AgentEditForm({ config, agent, idAccount, open, onOpenChange }) {
|
|
|
890
900
|
Input3,
|
|
891
901
|
{
|
|
892
902
|
id: "edit-delay",
|
|
903
|
+
name: "delay",
|
|
893
904
|
type: "number",
|
|
894
905
|
value: form.delayTyping,
|
|
895
906
|
onChange: (e) => updateField("delayTyping", e.target.value),
|
|
@@ -907,6 +918,7 @@ function AgentEditForm({ config, agent, idAccount, open, onOpenChange }) {
|
|
|
907
918
|
Input3,
|
|
908
919
|
{
|
|
909
920
|
id: "edit-waiting",
|
|
921
|
+
name: "waiting",
|
|
910
922
|
type: "number",
|
|
911
923
|
value: form.waitingTime,
|
|
912
924
|
onChange: (e) => updateField("waitingTime", e.target.value),
|
|
@@ -931,7 +943,7 @@ function AgentEditForm({ config, agent, idAccount, open, onOpenChange }) {
|
|
|
931
943
|
}
|
|
932
944
|
),
|
|
933
945
|
/* @__PURE__ */ jsxs3(Button3, { type: "submit", disabled: updateAgent.isPending, children: [
|
|
934
|
-
updateAgent.isPending && /* @__PURE__ */ jsx3(Loader22, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
946
|
+
updateAgent.isPending && /* @__PURE__ */ jsx3(Loader22, { "aria-hidden": "true", className: "mr-2 h-4 w-4 animate-spin" }),
|
|
935
947
|
"Salvar"
|
|
936
948
|
] })
|
|
937
949
|
] })
|
|
@@ -1100,7 +1112,9 @@ function AgentToolsList({ agent, config }) {
|
|
|
1100
1112
|
/* @__PURE__ */ jsx4("div", { className: "p-2", children: /* @__PURE__ */ jsx4(
|
|
1101
1113
|
Input4,
|
|
1102
1114
|
{
|
|
1103
|
-
placeholder: "Buscar ferramenta
|
|
1115
|
+
placeholder: "Buscar ferramenta\\u2026",
|
|
1116
|
+
"aria-label": "Buscar ferramenta",
|
|
1117
|
+
name: "search",
|
|
1104
1118
|
value: search,
|
|
1105
1119
|
onChange: (e) => setSearch(e.target.value),
|
|
1106
1120
|
className: "h-8"
|
|
@@ -1144,6 +1158,7 @@ function AgentToolsList({ agent, config }) {
|
|
|
1144
1158
|
/* @__PURE__ */ jsx4(
|
|
1145
1159
|
Switch2,
|
|
1146
1160
|
{
|
|
1161
|
+
"aria-label": "Ativar/Desativar",
|
|
1147
1162
|
checked: agentTool.enabled,
|
|
1148
1163
|
onCheckedChange: (checked) => handleToggleEnabled(agentTool, checked),
|
|
1149
1164
|
disabled: updateMutation.isPending
|
|
@@ -1154,6 +1169,7 @@ function AgentToolsList({ agent, config }) {
|
|
|
1154
1169
|
{
|
|
1155
1170
|
variant: "ghost",
|
|
1156
1171
|
size: "icon",
|
|
1172
|
+
"aria-label": "Configurar",
|
|
1157
1173
|
className: "shrink-0 text-muted-foreground hover:text-foreground",
|
|
1158
1174
|
onClick: () => openConfig(agentTool),
|
|
1159
1175
|
title: "Configurar instru\xE7\xF5es",
|
|
@@ -1165,6 +1181,7 @@ function AgentToolsList({ agent, config }) {
|
|
|
1165
1181
|
{
|
|
1166
1182
|
variant: "ghost",
|
|
1167
1183
|
size: "icon",
|
|
1184
|
+
"aria-label": "Remover",
|
|
1168
1185
|
className: "shrink-0 text-muted-foreground hover:text-destructive",
|
|
1169
1186
|
onClick: () => setRemoveTarget(agentTool),
|
|
1170
1187
|
children: /* @__PURE__ */ jsx4(Trash22, { className: "h-4 w-4" })
|
|
@@ -1184,14 +1201,14 @@ function AgentToolsList({ agent, config }) {
|
|
|
1184
1201
|
/* @__PURE__ */ jsx4(DialogHeader3, { children: /* @__PURE__ */ jsx4(DialogTitle3, { children: "Instru\xE7\xF5es da Ferramenta" }) }),
|
|
1185
1202
|
/* @__PURE__ */ jsxs4("div", { className: "space-y-4", children: [
|
|
1186
1203
|
configTarget && getToolInfo(configTarget.id_tool)?.type !== "none" && /* @__PURE__ */ jsxs4("div", { className: "space-y-2", children: [
|
|
1187
|
-
/* @__PURE__ */ jsx4(Label3, { children: "Credencial" }),
|
|
1204
|
+
/* @__PURE__ */ jsx4(Label3, { htmlFor: "tool-credential", children: "Credencial" }),
|
|
1188
1205
|
/* @__PURE__ */ jsxs4(
|
|
1189
1206
|
Select,
|
|
1190
1207
|
{
|
|
1191
1208
|
value: configCredentialId || void 0,
|
|
1192
1209
|
onValueChange: (val) => setConfigCredentialId(val === "__none__" ? "" : val),
|
|
1193
1210
|
children: [
|
|
1194
|
-
/* @__PURE__ */ jsx4(SelectTrigger, { children: /* @__PURE__ */ jsx4(SelectValue, { placeholder: "Selecione uma credencial (opcional)" }) }),
|
|
1211
|
+
/* @__PURE__ */ jsx4(SelectTrigger, { id: "tool-credential", children: /* @__PURE__ */ jsx4(SelectValue, { placeholder: "Selecione uma credencial (opcional)" }) }),
|
|
1195
1212
|
/* @__PURE__ */ jsxs4(SelectContent, { children: [
|
|
1196
1213
|
/* @__PURE__ */ jsx4(SelectItem, { value: "__none__", children: "Nenhuma (autom\xE1tico)" }),
|
|
1197
1214
|
allCredentials.filter((c) => configTarget && c.id_tool === configTarget.id_tool && c.status === "active").map((c) => /* @__PURE__ */ jsx4(SelectItem, { value: String(c.id), children: c.label || `Credencial #${c.id}` }, c.id))
|
|
@@ -1202,13 +1219,15 @@ function AgentToolsList({ agent, config }) {
|
|
|
1202
1219
|
/* @__PURE__ */ jsx4("p", { className: "text-xs text-muted-foreground", children: "Vincule uma credencial espec\xEDfica a esta ferramenta neste agente." })
|
|
1203
1220
|
] }),
|
|
1204
1221
|
/* @__PURE__ */ jsxs4("div", { className: "space-y-2", children: [
|
|
1205
|
-
/* @__PURE__ */ jsx4(Label3, { children: "Instru\xE7\xF5es Personalizadas" }),
|
|
1222
|
+
/* @__PURE__ */ jsx4(Label3, { htmlFor: "tool-instructions", children: "Instru\xE7\xF5es Personalizadas" }),
|
|
1206
1223
|
/* @__PURE__ */ jsx4(
|
|
1207
1224
|
Textarea,
|
|
1208
1225
|
{
|
|
1226
|
+
id: "tool-instructions",
|
|
1227
|
+
name: "instructions",
|
|
1209
1228
|
value: configInstructions,
|
|
1210
1229
|
onChange: (e) => setConfigInstructions(e.target.value),
|
|
1211
|
-
placeholder: "Instru
|
|
1230
|
+
placeholder: "Instru\\u00e7\\u00f5es sobre como e quando o agente deve usar esta ferramenta\\u2026",
|
|
1212
1231
|
rows: 6
|
|
1213
1232
|
}
|
|
1214
1233
|
),
|
|
@@ -1903,7 +1922,7 @@ function AgentObjectivesList({ agent, config }) {
|
|
|
1903
1922
|
value: objective.id,
|
|
1904
1923
|
className: "flex items-center gap-3 rounded-lg border bg-card p-3",
|
|
1905
1924
|
children: [
|
|
1906
|
-
/* @__PURE__ */ jsx6(SortableItemHandle, { className: "shrink-0 text-muted-foreground hover:text-foreground", children: /* @__PURE__ */ jsx6(GripVertical, { className: "h-5 w-5" }) }),
|
|
1925
|
+
/* @__PURE__ */ jsx6(SortableItemHandle, { className: "shrink-0 text-muted-foreground hover:text-foreground", children: /* @__PURE__ */ jsx6(GripVertical, { "aria-hidden": "true", className: "h-5 w-5" }) }),
|
|
1907
1926
|
/* @__PURE__ */ jsxs5("div", { className: "flex flex-1 flex-col gap-1 min-w-0", children: [
|
|
1908
1927
|
/* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-2", children: [
|
|
1909
1928
|
/* @__PURE__ */ jsx6("span", { className: "truncate font-medium", children: objective.title }),
|
|
@@ -1914,6 +1933,7 @@ function AgentObjectivesList({ agent, config }) {
|
|
|
1914
1933
|
/* @__PURE__ */ jsx6(
|
|
1915
1934
|
Switch3,
|
|
1916
1935
|
{
|
|
1936
|
+
"aria-label": "Ativar/Desativar",
|
|
1917
1937
|
checked: objective.active,
|
|
1918
1938
|
onCheckedChange: (checked) => handleToggleActive(objective, checked),
|
|
1919
1939
|
disabled: updateMutation.isPending
|
|
@@ -1924,6 +1944,7 @@ function AgentObjectivesList({ agent, config }) {
|
|
|
1924
1944
|
{
|
|
1925
1945
|
variant: "ghost",
|
|
1926
1946
|
size: "icon",
|
|
1947
|
+
"aria-label": "Editar",
|
|
1927
1948
|
className: "shrink-0 text-muted-foreground hover:text-foreground",
|
|
1928
1949
|
onClick: () => openEdit(objective),
|
|
1929
1950
|
children: /* @__PURE__ */ jsx6(Pencil2, { className: "h-4 w-4" })
|
|
@@ -1934,6 +1955,7 @@ function AgentObjectivesList({ agent, config }) {
|
|
|
1934
1955
|
{
|
|
1935
1956
|
variant: "ghost",
|
|
1936
1957
|
size: "icon",
|
|
1958
|
+
"aria-label": "Excluir",
|
|
1937
1959
|
className: "shrink-0 text-muted-foreground hover:text-destructive",
|
|
1938
1960
|
onClick: () => setRemoveTarget(objective),
|
|
1939
1961
|
children: /* @__PURE__ */ jsx6(Trash23, { className: "h-4 w-4" })
|
|
@@ -1946,7 +1968,7 @@ function AgentObjectivesList({ agent, config }) {
|
|
|
1946
1968
|
/* @__PURE__ */ jsx6(SortableOverlay, { children: ({ value }) => {
|
|
1947
1969
|
const obj = sortedObjectives.find((o) => o.id === value);
|
|
1948
1970
|
return /* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-3 rounded-lg border bg-card p-3 shadow-lg", children: [
|
|
1949
|
-
/* @__PURE__ */ jsx6(GripVertical, { className: "h-5 w-5 text-muted-foreground" }),
|
|
1971
|
+
/* @__PURE__ */ jsx6(GripVertical, { "aria-hidden": "true", className: "h-5 w-5 text-muted-foreground" }),
|
|
1950
1972
|
/* @__PURE__ */ jsx6("span", { className: "font-medium", children: obj?.title })
|
|
1951
1973
|
] });
|
|
1952
1974
|
} })
|
|
@@ -1957,10 +1979,12 @@ function AgentObjectivesList({ agent, config }) {
|
|
|
1957
1979
|
/* @__PURE__ */ jsx6(DialogHeader4, { children: /* @__PURE__ */ jsx6(DialogTitle4, { children: editTarget ? "Editar Objetivo" : "Novo Objetivo" }) }),
|
|
1958
1980
|
/* @__PURE__ */ jsxs5("div", { className: "space-y-4", children: [
|
|
1959
1981
|
/* @__PURE__ */ jsxs5("div", { className: "space-y-2", children: [
|
|
1960
|
-
/* @__PURE__ */ jsx6(Label4, { children: "T\xEDtulo *" }),
|
|
1982
|
+
/* @__PURE__ */ jsx6(Label4, { htmlFor: "objective-title", children: "T\xEDtulo *" }),
|
|
1961
1983
|
/* @__PURE__ */ jsx6(
|
|
1962
1984
|
Input5,
|
|
1963
1985
|
{
|
|
1986
|
+
id: "objective-title",
|
|
1987
|
+
name: "title",
|
|
1964
1988
|
value: form.title,
|
|
1965
1989
|
onChange: (e) => {
|
|
1966
1990
|
const title = e.target.value;
|
|
@@ -1975,10 +1999,12 @@ function AgentObjectivesList({ agent, config }) {
|
|
|
1975
1999
|
)
|
|
1976
2000
|
] }),
|
|
1977
2001
|
/* @__PURE__ */ jsxs5("div", { className: "space-y-2", children: [
|
|
1978
|
-
/* @__PURE__ */ jsx6(Label4, { children: "Slug (identificador) *" }),
|
|
2002
|
+
/* @__PURE__ */ jsx6(Label4, { htmlFor: "objective-slug", children: "Slug (identificador) *" }),
|
|
1979
2003
|
/* @__PURE__ */ jsx6(
|
|
1980
2004
|
Input5,
|
|
1981
2005
|
{
|
|
2006
|
+
id: "objective-slug",
|
|
2007
|
+
name: "slug",
|
|
1982
2008
|
value: form.slug,
|
|
1983
2009
|
onChange: (e) => {
|
|
1984
2010
|
setSlugManual(true);
|
|
@@ -1991,13 +2017,15 @@ function AgentObjectivesList({ agent, config }) {
|
|
|
1991
2017
|
/* @__PURE__ */ jsx6("p", { className: "text-xs text-muted-foreground", children: "Gerado automaticamente. Usado pelo agente para identificar o objetivo." })
|
|
1992
2018
|
] }),
|
|
1993
2019
|
/* @__PURE__ */ jsxs5("div", { className: "space-y-2", children: [
|
|
1994
|
-
/* @__PURE__ */ jsx6(Label4, { children: "Instru\xE7\xF5es do Objetivo" }),
|
|
2020
|
+
/* @__PURE__ */ jsx6(Label4, { htmlFor: "objective-prompt", children: "Instru\xE7\xF5es do Objetivo" }),
|
|
1995
2021
|
/* @__PURE__ */ jsx6(
|
|
1996
2022
|
Textarea2,
|
|
1997
2023
|
{
|
|
2024
|
+
id: "objective-prompt",
|
|
2025
|
+
name: "prompt",
|
|
1998
2026
|
value: form.prompt,
|
|
1999
2027
|
onChange: (e) => setForm((f) => ({ ...f, prompt: e.target.value })),
|
|
2000
|
-
placeholder: "Instru
|
|
2028
|
+
placeholder: "Instru\\u00e7\\u00f5es detalhadas que o agente seguir\\u00e1 quando este objetivo for ativado\\u2026",
|
|
2001
2029
|
rows: 8
|
|
2002
2030
|
}
|
|
2003
2031
|
),
|
|
@@ -2206,22 +2234,24 @@ function AgentPromptEditor({ config, agent }) {
|
|
|
2206
2234
|
"textarea",
|
|
2207
2235
|
{
|
|
2208
2236
|
ref: textareaRef,
|
|
2237
|
+
"aria-label": "Prompt do sistema",
|
|
2238
|
+
name: "prompt",
|
|
2209
2239
|
value: promptText,
|
|
2210
2240
|
onChange: (e) => setPromptText(e.target.value),
|
|
2211
2241
|
onKeyDown: handleKeyDown,
|
|
2212
|
-
placeholder: "Escreva o prompt do sistema aqui
|
|
2242
|
+
placeholder: "Escreva o prompt do sistema aqui\\u2026",
|
|
2213
2243
|
disabled: updateAgent.isPending,
|
|
2214
2244
|
className: "w-full resize-none rounded-lg border bg-background p-3 font-mono text-sm leading-relaxed focus:outline-none focus:ring-2 focus:ring-ring disabled:opacity-50",
|
|
2215
2245
|
style: { minHeight: "300px" }
|
|
2216
2246
|
}
|
|
2217
2247
|
),
|
|
2218
2248
|
/* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-3 text-xs text-muted-foreground", children: [
|
|
2219
|
-
/* @__PURE__ */ jsxs6("span", { children: [
|
|
2249
|
+
/* @__PURE__ */ jsxs6("span", { className: "tabular-nums", children: [
|
|
2220
2250
|
charCount.toLocaleString("pt-BR"),
|
|
2221
2251
|
" caracteres"
|
|
2222
2252
|
] }),
|
|
2223
2253
|
/* @__PURE__ */ jsx7("span", { children: "\xB7" }),
|
|
2224
|
-
/* @__PURE__ */ jsxs6("span", { children: [
|
|
2254
|
+
/* @__PURE__ */ jsxs6("span", { className: "tabular-nums", children: [
|
|
2225
2255
|
"~",
|
|
2226
2256
|
tokenEstimate.toLocaleString("pt-BR"),
|
|
2227
2257
|
" tokens"
|
|
@@ -2232,6 +2262,8 @@ function AgentPromptEditor({ config, agent }) {
|
|
|
2232
2262
|
/* @__PURE__ */ jsx7(
|
|
2233
2263
|
Input6,
|
|
2234
2264
|
{
|
|
2265
|
+
"aria-label": "Notas da altera\xE7\xE3o",
|
|
2266
|
+
name: "changeNotes",
|
|
2235
2267
|
value: changeNotes,
|
|
2236
2268
|
onChange: (e) => setChangeNotes(e.target.value),
|
|
2237
2269
|
placeholder: "O que mudou? (opcional)",
|
|
@@ -2356,7 +2388,7 @@ function AgentPromptEditor({ config, agent }) {
|
|
|
2356
2388
|
onClick: () => setCompareVersionId(isComparing ? null : version.id),
|
|
2357
2389
|
className: "flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground",
|
|
2358
2390
|
children: [
|
|
2359
|
-
/* @__PURE__ */ jsx7(FileText, { className: "h-3 w-3" }),
|
|
2391
|
+
/* @__PURE__ */ jsx7(FileText, { "aria-hidden": "true", className: "h-3 w-3" }),
|
|
2360
2392
|
isComparing ? "Ocultar diff" : "Comparar"
|
|
2361
2393
|
]
|
|
2362
2394
|
}
|
|
@@ -2368,7 +2400,7 @@ function AgentPromptEditor({ config, agent }) {
|
|
|
2368
2400
|
onClick: () => handleRestore(version),
|
|
2369
2401
|
className: "flex items-center gap-1 text-xs text-primary hover:underline",
|
|
2370
2402
|
children: [
|
|
2371
|
-
/* @__PURE__ */ jsx7(RotateCcw, { className: "h-3 w-3" }),
|
|
2403
|
+
/* @__PURE__ */ jsx7(RotateCcw, { "aria-hidden": "true", className: "h-3 w-3" }),
|
|
2372
2404
|
"Restaurar"
|
|
2373
2405
|
]
|
|
2374
2406
|
}
|
|
@@ -2422,7 +2454,7 @@ function ConversationView({
|
|
|
2422
2454
|
if (!conversation) {
|
|
2423
2455
|
return /* @__PURE__ */ jsx8("div", { className: "rounded-lg border bg-card p-4", children: /* @__PURE__ */ jsxs7("div", { className: "flex items-center justify-between", children: [
|
|
2424
2456
|
/* @__PURE__ */ jsx8("p", { className: "text-sm text-muted-foreground", children: "Conversa n\xE3o encontrada." }),
|
|
2425
|
-
/* @__PURE__ */ jsx8(Button7, { variant: "ghost", size: "icon", onClick: onClose, children: /* @__PURE__ */ jsx8(X, { className: "h-4 w-4" }) })
|
|
2457
|
+
/* @__PURE__ */ jsx8(Button7, { variant: "ghost", size: "icon", "aria-label": "Fechar", onClick: onClose, children: /* @__PURE__ */ jsx8(X, { className: "h-4 w-4" }) })
|
|
2426
2458
|
] }) });
|
|
2427
2459
|
}
|
|
2428
2460
|
return /* @__PURE__ */ jsxs7("div", { className: "rounded-lg border bg-card p-4 space-y-4", children: [
|
|
@@ -2431,7 +2463,7 @@ function ConversationView({
|
|
|
2431
2463
|
"Detalhes da conversa #",
|
|
2432
2464
|
conversation.id
|
|
2433
2465
|
] }),
|
|
2434
|
-
/* @__PURE__ */ jsx8("div", { className: "flex items-center gap-1", children: /* @__PURE__ */ jsx8(Button7, { variant: "ghost", size: "icon", onClick: onClose, children: /* @__PURE__ */ jsx8(X, { className: "h-4 w-4" }) }) })
|
|
2466
|
+
/* @__PURE__ */ jsx8("div", { className: "flex items-center gap-1", children: /* @__PURE__ */ jsx8(Button7, { variant: "ghost", size: "icon", "aria-label": "Fechar", onClick: onClose, children: /* @__PURE__ */ jsx8(X, { className: "h-4 w-4" }) }) })
|
|
2435
2467
|
] }),
|
|
2436
2468
|
conversation.id_external ? renderChatLink ? renderChatLink(conversation.id_external) : /* @__PURE__ */ jsx8(Button7, { variant: "outline", size: "sm", asChild: true, children: /* @__PURE__ */ jsxs7("a", { href: `/gchat/inbox/${conversation.id_external}`, children: [
|
|
2437
2469
|
/* @__PURE__ */ jsx8(MessageSquare, { className: "mr-2 h-4 w-4" }),
|
|
@@ -2524,16 +2556,26 @@ function AgentConversationsTable({
|
|
|
2524
2556
|
TableRow,
|
|
2525
2557
|
{
|
|
2526
2558
|
className: "cursor-pointer",
|
|
2559
|
+
role: "button",
|
|
2560
|
+
tabIndex: 0,
|
|
2527
2561
|
onClick: () => setSelectedId(
|
|
2528
2562
|
selectedId === conversation.id ? null : conversation.id
|
|
2529
2563
|
),
|
|
2564
|
+
onKeyDown: (e) => {
|
|
2565
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
2566
|
+
e.preventDefault();
|
|
2567
|
+
setSelectedId(
|
|
2568
|
+
selectedId === conversation.id ? null : conversation.id
|
|
2569
|
+
);
|
|
2570
|
+
}
|
|
2571
|
+
},
|
|
2530
2572
|
"data-state": selectedId === conversation.id ? "selected" : void 0,
|
|
2531
2573
|
children: [
|
|
2532
2574
|
/* @__PURE__ */ jsx9(TableCell, { className: "font-mono text-xs", children: conversation.id }),
|
|
2533
2575
|
/* @__PURE__ */ jsx9(TableCell, { children: contactsMap?.get(conversation.id_contact) ?? conversation.id_contact }),
|
|
2534
2576
|
/* @__PURE__ */ jsx9(TableCell, { children: conversation.id_objective && objectivesMap?.get(conversation.id_objective) ? /* @__PURE__ */ jsx9(Badge5, { variant: "secondary", className: "text-xs", children: objectivesMap.get(conversation.id_objective) }) : /* @__PURE__ */ jsx9("span", { className: "text-xs text-muted-foreground", children: "\u2014" }) }),
|
|
2535
|
-
/* @__PURE__ */ jsx9(TableCell, { className: "text-right", children: conversation.message_count ?? "\u2014" }),
|
|
2536
|
-
/* @__PURE__ */ jsx9(TableCell, { className: "text-right", children: conversation.usage_tokens ?? "\u2014" }),
|
|
2577
|
+
/* @__PURE__ */ jsx9(TableCell, { className: "text-right tabular-nums", children: conversation.message_count ?? "\u2014" }),
|
|
2578
|
+
/* @__PURE__ */ jsx9(TableCell, { className: "text-right tabular-nums", children: conversation.usage_tokens ?? "\u2014" }),
|
|
2537
2579
|
/* @__PURE__ */ jsx9(TableCell, { children: new Date(conversation.datetime_add).toLocaleDateString("pt-BR") }),
|
|
2538
2580
|
/* @__PURE__ */ jsx9(TableCell, { children: formatRelativeDate(conversation.datetime_alt) }),
|
|
2539
2581
|
/* @__PURE__ */ jsx9(TableCell, { children: conversation.id_external ? renderChatLink ? /* @__PURE__ */ jsx9("span", { onClick: (e) => e.stopPropagation(), children: renderChatLink(conversation.id_external) }) : /* @__PURE__ */ jsx9(
|
|
@@ -2541,6 +2583,7 @@ function AgentConversationsTable({
|
|
|
2541
2583
|
{
|
|
2542
2584
|
href: `/gchat/inbox/${conversation.id_external}`,
|
|
2543
2585
|
title: "Ver no Chat",
|
|
2586
|
+
"aria-label": "Ver no Chat",
|
|
2544
2587
|
onClick: (e) => e.stopPropagation(),
|
|
2545
2588
|
className: "inline-flex items-center justify-center rounded-md p-1.5 text-muted-foreground hover:text-foreground hover:bg-accent transition-colors",
|
|
2546
2589
|
children: /* @__PURE__ */ jsx9(ExternalLink, { className: "h-4 w-4" })
|
|
@@ -2610,19 +2653,19 @@ function AgentTabs({ agent, config, renderChatLink }) {
|
|
|
2610
2653
|
return /* @__PURE__ */ jsxs9(Tabs, { defaultValue: "prompt", children: [
|
|
2611
2654
|
/* @__PURE__ */ jsxs9(TabsList, { children: [
|
|
2612
2655
|
/* @__PURE__ */ jsxs9(TabsTrigger, { value: "prompt", className: "flex items-center gap-1.5", children: [
|
|
2613
|
-
/* @__PURE__ */ jsx11(FileText2, { className: "h-3.5 w-3.5" }),
|
|
2656
|
+
/* @__PURE__ */ jsx11(FileText2, { "aria-hidden": "true", className: "h-3.5 w-3.5" }),
|
|
2614
2657
|
"Prompt"
|
|
2615
2658
|
] }),
|
|
2616
2659
|
/* @__PURE__ */ jsxs9(TabsTrigger, { value: "objetivos", className: "flex items-center gap-1.5", children: [
|
|
2617
|
-
/* @__PURE__ */ jsx11(Target2, { className: "h-3.5 w-3.5" }),
|
|
2660
|
+
/* @__PURE__ */ jsx11(Target2, { "aria-hidden": "true", className: "h-3.5 w-3.5" }),
|
|
2618
2661
|
"Objetivos"
|
|
2619
2662
|
] }),
|
|
2620
2663
|
/* @__PURE__ */ jsxs9(TabsTrigger, { value: "ferramentas", className: "flex items-center gap-1.5", children: [
|
|
2621
|
-
/* @__PURE__ */ jsx11(Wrench2, { className: "h-3.5 w-3.5" }),
|
|
2664
|
+
/* @__PURE__ */ jsx11(Wrench2, { "aria-hidden": "true", className: "h-3.5 w-3.5" }),
|
|
2622
2665
|
"Ferramentas"
|
|
2623
2666
|
] }),
|
|
2624
2667
|
/* @__PURE__ */ jsxs9(TabsTrigger, { value: "conversas", className: "flex items-center gap-1.5", children: [
|
|
2625
|
-
/* @__PURE__ */ jsx11(MessageCircle2, { className: "h-3.5 w-3.5" }),
|
|
2668
|
+
/* @__PURE__ */ jsx11(MessageCircle2, { "aria-hidden": "true", className: "h-3.5 w-3.5" }),
|
|
2626
2669
|
"Conversas"
|
|
2627
2670
|
] })
|
|
2628
2671
|
] }),
|
|
@@ -2688,7 +2731,7 @@ function useColumns2(onEdit, onDelete) {
|
|
|
2688
2731
|
cell: ({ row }) => {
|
|
2689
2732
|
const desc = row.original.description;
|
|
2690
2733
|
if (!desc) return /* @__PURE__ */ jsx12("span", { className: "text-muted-foreground text-sm", children: "\u2014" });
|
|
2691
|
-
return /* @__PURE__ */ jsx12("span", { className: "text-muted-foreground text-sm", children: desc.length > 50 ? `${desc.slice(0, 50)}
|
|
2734
|
+
return /* @__PURE__ */ jsx12("span", { className: "text-muted-foreground text-sm", children: desc.length > 50 ? `${desc.slice(0, 50)}\u2026` : desc });
|
|
2692
2735
|
}
|
|
2693
2736
|
},
|
|
2694
2737
|
{
|
|
@@ -2710,6 +2753,7 @@ function useColumns2(onEdit, onDelete) {
|
|
|
2710
2753
|
variant: "ghost",
|
|
2711
2754
|
size: "icon",
|
|
2712
2755
|
className: "h-8 w-8",
|
|
2756
|
+
"aria-label": "Editar",
|
|
2713
2757
|
onClick: () => onEdit(row.original),
|
|
2714
2758
|
children: /* @__PURE__ */ jsx12(Pencil3, { className: "h-4 w-4" })
|
|
2715
2759
|
}
|
|
@@ -2723,6 +2767,7 @@ function useColumns2(onEdit, onDelete) {
|
|
|
2723
2767
|
variant: "ghost",
|
|
2724
2768
|
size: "icon",
|
|
2725
2769
|
className: "h-8 w-8 text-destructive hover:text-destructive",
|
|
2770
|
+
"aria-label": "Excluir",
|
|
2726
2771
|
onClick: () => onDelete(row.original.id),
|
|
2727
2772
|
children: /* @__PURE__ */ jsx12(Trash24, { className: "h-4 w-4" })
|
|
2728
2773
|
}
|
|
@@ -2771,11 +2816,14 @@ function ToolsTable({ onEdit, config }) {
|
|
|
2771
2816
|
}
|
|
2772
2817
|
return /* @__PURE__ */ jsxs10(Fragment2, { children: [
|
|
2773
2818
|
/* @__PURE__ */ jsx12("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ jsxs10("div", { className: "relative flex-1 max-w-md", children: [
|
|
2774
|
-
/* @__PURE__ */ jsx12(Search2, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
2819
|
+
/* @__PURE__ */ jsx12(Search2, { "aria-hidden": "true", className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
2775
2820
|
/* @__PURE__ */ jsx12(
|
|
2776
2821
|
Input7,
|
|
2777
2822
|
{
|
|
2778
|
-
placeholder: "Buscar ferramentas
|
|
2823
|
+
placeholder: "Buscar ferramentas\\u2026",
|
|
2824
|
+
"aria-label": "Buscar ferramentas",
|
|
2825
|
+
name: "search",
|
|
2826
|
+
autoComplete: "off",
|
|
2779
2827
|
value: search,
|
|
2780
2828
|
onChange: (e) => handleSearchChange(e.target.value),
|
|
2781
2829
|
className: "pl-9"
|
|
@@ -2963,6 +3011,7 @@ function ToolFormDialog({
|
|
|
2963
3011
|
Input8,
|
|
2964
3012
|
{
|
|
2965
3013
|
id: "tool-name",
|
|
3014
|
+
name: "name",
|
|
2966
3015
|
value: form.name,
|
|
2967
3016
|
onChange: (e) => {
|
|
2968
3017
|
const name = e.target.value;
|
|
@@ -2985,6 +3034,7 @@ function ToolFormDialog({
|
|
|
2985
3034
|
Input8,
|
|
2986
3035
|
{
|
|
2987
3036
|
id: "tool-slug",
|
|
3037
|
+
name: "slug",
|
|
2988
3038
|
value: form.slug,
|
|
2989
3039
|
onChange: (e) => {
|
|
2990
3040
|
setSlugManuallyEdited(true);
|
|
@@ -3030,9 +3080,10 @@ function ToolFormDialog({
|
|
|
3030
3080
|
Textarea3,
|
|
3031
3081
|
{
|
|
3032
3082
|
id: "tool-description",
|
|
3083
|
+
name: "description",
|
|
3033
3084
|
value: form.description,
|
|
3034
3085
|
onChange: (e) => setForm((prev) => ({ ...prev, description: e.target.value })),
|
|
3035
|
-
placeholder: "Descri
|
|
3086
|
+
placeholder: "Descri\\u00e7\\u00e3o da ferramenta\\u2026",
|
|
3036
3087
|
rows: 3,
|
|
3037
3088
|
disabled: isPending
|
|
3038
3089
|
}
|
|
@@ -3044,6 +3095,7 @@ function ToolFormDialog({
|
|
|
3044
3095
|
Textarea3,
|
|
3045
3096
|
{
|
|
3046
3097
|
id: "tool-function-defs",
|
|
3098
|
+
name: "functionDefs",
|
|
3047
3099
|
value: form.functionDefinitions,
|
|
3048
3100
|
onChange: (e) => {
|
|
3049
3101
|
setForm((prev) => ({
|
|
@@ -3060,8 +3112,8 @@ function ToolFormDialog({
|
|
|
3060
3112
|
"description": "O que a fun\xE7\xE3o faz",
|
|
3061
3113
|
"parameters": {
|
|
3062
3114
|
"type": "object",
|
|
3063
|
-
"properties": {
|
|
3064
|
-
"required": [
|
|
3115
|
+
"properties": { \u2026 },
|
|
3116
|
+
"required": [\u2026]
|
|
3065
3117
|
}
|
|
3066
3118
|
}
|
|
3067
3119
|
}
|
|
@@ -3086,7 +3138,7 @@ function ToolFormDialog({
|
|
|
3086
3138
|
}
|
|
3087
3139
|
),
|
|
3088
3140
|
/* @__PURE__ */ jsxs11(Button9, { type: "submit", disabled: isPending, children: [
|
|
3089
|
-
isPending ? /* @__PURE__ */ jsx13(Loader24, { className: "mr-2 h-4 w-4 animate-spin" }) : null,
|
|
3141
|
+
isPending ? /* @__PURE__ */ jsx13(Loader24, { "aria-hidden": "true", className: "mr-2 h-4 w-4 animate-spin" }) : null,
|
|
3090
3142
|
isEditing ? "Salvar" : "Criar"
|
|
3091
3143
|
] })
|
|
3092
3144
|
] })
|
|
@@ -3188,6 +3240,7 @@ function useColumns3(tools, onEdit, onConnect, onRemove) {
|
|
|
3188
3240
|
variant: "ghost",
|
|
3189
3241
|
size: "icon",
|
|
3190
3242
|
className: "h-8 w-8",
|
|
3243
|
+
"aria-label": "Vincular",
|
|
3191
3244
|
disabled: true,
|
|
3192
3245
|
children: /* @__PURE__ */ jsx14(Link, { className: "h-4 w-4" })
|
|
3193
3246
|
}
|
|
@@ -3201,6 +3254,7 @@ function useColumns3(tools, onEdit, onConnect, onRemove) {
|
|
|
3201
3254
|
variant: "ghost",
|
|
3202
3255
|
size: "icon",
|
|
3203
3256
|
className: "h-8 w-8",
|
|
3257
|
+
"aria-label": "Editar",
|
|
3204
3258
|
onClick: () => onEdit(row.original),
|
|
3205
3259
|
children: /* @__PURE__ */ jsx14(Pencil4, { className: "h-4 w-4" })
|
|
3206
3260
|
}
|
|
@@ -3214,6 +3268,7 @@ function useColumns3(tools, onEdit, onConnect, onRemove) {
|
|
|
3214
3268
|
variant: "ghost",
|
|
3215
3269
|
size: "icon",
|
|
3216
3270
|
className: "h-8 w-8 text-destructive hover:text-destructive",
|
|
3271
|
+
"aria-label": "Excluir",
|
|
3217
3272
|
onClick: () => onRemove(row.original),
|
|
3218
3273
|
children: /* @__PURE__ */ jsx14(Trash25, { className: "h-4 w-4" })
|
|
3219
3274
|
}
|
|
@@ -3363,11 +3418,14 @@ function ToolCredentialsForm({
|
|
|
3363
3418
|
}
|
|
3364
3419
|
return /* @__PURE__ */ jsxs12("div", { className: "space-y-4", children: [
|
|
3365
3420
|
/* @__PURE__ */ jsx14("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ jsxs12("div", { className: "relative flex-1 max-w-md", children: [
|
|
3366
|
-
/* @__PURE__ */ jsx14(Search3, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
3421
|
+
/* @__PURE__ */ jsx14(Search3, { "aria-hidden": "true", className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
3367
3422
|
/* @__PURE__ */ jsx14(
|
|
3368
3423
|
Input9,
|
|
3369
3424
|
{
|
|
3370
|
-
placeholder: "Buscar credenciais
|
|
3425
|
+
placeholder: "Buscar credenciais\\u2026",
|
|
3426
|
+
"aria-label": "Buscar credenciais",
|
|
3427
|
+
name: "search",
|
|
3428
|
+
autoComplete: "off",
|
|
3371
3429
|
value: search,
|
|
3372
3430
|
onChange: (e) => setSearch(e.target.value),
|
|
3373
3431
|
className: "pl-9"
|
|
@@ -3387,24 +3445,26 @@ function ToolCredentialsForm({
|
|
|
3387
3445
|
/* @__PURE__ */ jsx14(DialogHeader6, { children: /* @__PURE__ */ jsx14(DialogTitle6, { children: "Nova Credencial" }) }),
|
|
3388
3446
|
/* @__PURE__ */ jsxs12("div", { className: "space-y-4", children: [
|
|
3389
3447
|
/* @__PURE__ */ jsxs12("div", { children: [
|
|
3390
|
-
/* @__PURE__ */ jsx14("label", { className: "mb-1 block text-sm font-medium", children: "Ferramenta *" }),
|
|
3448
|
+
/* @__PURE__ */ jsx14("label", { htmlFor: "cred-tool", className: "mb-1 block text-sm font-medium", children: "Ferramenta *" }),
|
|
3391
3449
|
/* @__PURE__ */ jsxs12(
|
|
3392
3450
|
Select3,
|
|
3393
3451
|
{
|
|
3394
3452
|
value: createForm.id_tool,
|
|
3395
3453
|
onValueChange: (val) => setCreateForm((f) => ({ ...f, id_tool: val })),
|
|
3396
3454
|
children: [
|
|
3397
|
-
/* @__PURE__ */ jsx14(SelectTrigger3, { children: /* @__PURE__ */ jsx14(SelectValue3, { placeholder: "Selecione a ferramenta" }) }),
|
|
3455
|
+
/* @__PURE__ */ jsx14(SelectTrigger3, { id: "cred-tool", children: /* @__PURE__ */ jsx14(SelectValue3, { placeholder: "Selecione a ferramenta" }) }),
|
|
3398
3456
|
/* @__PURE__ */ jsx14(SelectContent3, { children: tools.map((tool) => /* @__PURE__ */ jsx14(SelectItem3, { value: String(tool.id), children: tool.name }, tool.id)) })
|
|
3399
3457
|
]
|
|
3400
3458
|
}
|
|
3401
3459
|
)
|
|
3402
3460
|
] }),
|
|
3403
3461
|
/* @__PURE__ */ jsxs12("div", { children: [
|
|
3404
|
-
/* @__PURE__ */ jsx14("label", { className: "mb-1 block text-sm font-medium", children: "Label *" }),
|
|
3462
|
+
/* @__PURE__ */ jsx14("label", { htmlFor: "cred-label", className: "mb-1 block text-sm font-medium", children: "Label *" }),
|
|
3405
3463
|
/* @__PURE__ */ jsx14(
|
|
3406
3464
|
Input9,
|
|
3407
3465
|
{
|
|
3466
|
+
id: "cred-label",
|
|
3467
|
+
name: "label",
|
|
3408
3468
|
value: createForm.label,
|
|
3409
3469
|
onChange: (e) => setCreateForm((f) => ({ ...f, label: e.target.value })),
|
|
3410
3470
|
placeholder: "Ex: Google Calendar - Cl\xEDnica S\xE3o Paulo"
|
|
@@ -3412,10 +3472,13 @@ function ToolCredentialsForm({
|
|
|
3412
3472
|
)
|
|
3413
3473
|
] }),
|
|
3414
3474
|
/* @__PURE__ */ jsxs12("div", { children: [
|
|
3415
|
-
/* @__PURE__ */ jsx14("label", { className: "mb-1 block text-sm font-medium", children: "Credencial *" }),
|
|
3475
|
+
/* @__PURE__ */ jsx14("label", { htmlFor: "cred-credential", className: "mb-1 block text-sm font-medium", children: "Credencial *" }),
|
|
3416
3476
|
/* @__PURE__ */ jsx14(
|
|
3417
3477
|
Input9,
|
|
3418
3478
|
{
|
|
3479
|
+
id: "cred-credential",
|
|
3480
|
+
name: "credential",
|
|
3481
|
+
autoComplete: "off",
|
|
3419
3482
|
type: "password",
|
|
3420
3483
|
value: createForm.credentials_encrypted,
|
|
3421
3484
|
onChange: (e) => setCreateForm((f) => ({
|
|
@@ -3427,10 +3490,12 @@ function ToolCredentialsForm({
|
|
|
3427
3490
|
)
|
|
3428
3491
|
] }),
|
|
3429
3492
|
/* @__PURE__ */ jsxs12("div", { children: [
|
|
3430
|
-
/* @__PURE__ */ jsx14("label", { className: "mb-1 block text-sm font-medium", children: "Data de Expira\xE7\xE3o (opcional)" }),
|
|
3493
|
+
/* @__PURE__ */ jsx14("label", { htmlFor: "cred-expires", className: "mb-1 block text-sm font-medium", children: "Data de Expira\xE7\xE3o (opcional)" }),
|
|
3431
3494
|
/* @__PURE__ */ jsx14(
|
|
3432
3495
|
Input9,
|
|
3433
3496
|
{
|
|
3497
|
+
id: "cred-expires",
|
|
3498
|
+
name: "expires",
|
|
3434
3499
|
type: "date",
|
|
3435
3500
|
value: createForm.expires_at,
|
|
3436
3501
|
onChange: (e) => setCreateForm((f) => ({ ...f, expires_at: e.target.value }))
|
|
@@ -3466,24 +3531,26 @@ function ToolCredentialsForm({
|
|
|
3466
3531
|
/* @__PURE__ */ jsx14(DialogHeader6, { children: /* @__PURE__ */ jsx14(DialogTitle6, { children: "Editar Credencial" }) }),
|
|
3467
3532
|
/* @__PURE__ */ jsxs12("div", { className: "space-y-4", children: [
|
|
3468
3533
|
/* @__PURE__ */ jsxs12("div", { children: [
|
|
3469
|
-
/* @__PURE__ */ jsx14("label", { className: "mb-1 block text-sm font-medium", children: "Ferramenta *" }),
|
|
3534
|
+
/* @__PURE__ */ jsx14("label", { htmlFor: "edit-cred-tool", className: "mb-1 block text-sm font-medium", children: "Ferramenta *" }),
|
|
3470
3535
|
/* @__PURE__ */ jsxs12(
|
|
3471
3536
|
Select3,
|
|
3472
3537
|
{
|
|
3473
3538
|
value: editForm.id_tool,
|
|
3474
3539
|
onValueChange: (val) => setEditForm((f) => ({ ...f, id_tool: val })),
|
|
3475
3540
|
children: [
|
|
3476
|
-
/* @__PURE__ */ jsx14(SelectTrigger3, { children: /* @__PURE__ */ jsx14(SelectValue3, { placeholder: "Selecione a ferramenta" }) }),
|
|
3541
|
+
/* @__PURE__ */ jsx14(SelectTrigger3, { id: "edit-cred-tool", children: /* @__PURE__ */ jsx14(SelectValue3, { placeholder: "Selecione a ferramenta" }) }),
|
|
3477
3542
|
/* @__PURE__ */ jsx14(SelectContent3, { children: tools.map((tool) => /* @__PURE__ */ jsx14(SelectItem3, { value: String(tool.id), children: tool.name }, tool.id)) })
|
|
3478
3543
|
]
|
|
3479
3544
|
}
|
|
3480
3545
|
)
|
|
3481
3546
|
] }),
|
|
3482
3547
|
/* @__PURE__ */ jsxs12("div", { children: [
|
|
3483
|
-
/* @__PURE__ */ jsx14("label", { className: "mb-1 block text-sm font-medium", children: "Label" }),
|
|
3548
|
+
/* @__PURE__ */ jsx14("label", { htmlFor: "edit-cred-label", className: "mb-1 block text-sm font-medium", children: "Label" }),
|
|
3484
3549
|
/* @__PURE__ */ jsx14(
|
|
3485
3550
|
Input9,
|
|
3486
3551
|
{
|
|
3552
|
+
id: "edit-cred-label",
|
|
3553
|
+
name: "label",
|
|
3487
3554
|
value: editForm.label,
|
|
3488
3555
|
onChange: (e) => setEditForm((f) => ({ ...f, label: e.target.value })),
|
|
3489
3556
|
placeholder: "Label da credencial"
|
|
@@ -3491,10 +3558,13 @@ function ToolCredentialsForm({
|
|
|
3491
3558
|
)
|
|
3492
3559
|
] }),
|
|
3493
3560
|
/* @__PURE__ */ jsxs12("div", { children: [
|
|
3494
|
-
/* @__PURE__ */ jsx14("label", { className: "mb-1 block text-sm font-medium", children: "Nova Credencial (vazio = manter atual)" }),
|
|
3561
|
+
/* @__PURE__ */ jsx14("label", { htmlFor: "edit-cred-credential", className: "mb-1 block text-sm font-medium", children: "Nova Credencial (vazio = manter atual)" }),
|
|
3495
3562
|
/* @__PURE__ */ jsx14(
|
|
3496
3563
|
Input9,
|
|
3497
3564
|
{
|
|
3565
|
+
id: "edit-cred-credential",
|
|
3566
|
+
name: "credential",
|
|
3567
|
+
autoComplete: "off",
|
|
3498
3568
|
type: "password",
|
|
3499
3569
|
value: editForm.credentials_encrypted,
|
|
3500
3570
|
onChange: (e) => setEditForm((f) => ({
|
|
@@ -3506,10 +3576,12 @@ function ToolCredentialsForm({
|
|
|
3506
3576
|
)
|
|
3507
3577
|
] }),
|
|
3508
3578
|
/* @__PURE__ */ jsxs12("div", { children: [
|
|
3509
|
-
/* @__PURE__ */ jsx14("label", { className: "mb-1 block text-sm font-medium", children: "Data de Expira\xE7\xE3o" }),
|
|
3579
|
+
/* @__PURE__ */ jsx14("label", { htmlFor: "edit-cred-expires", className: "mb-1 block text-sm font-medium", children: "Data de Expira\xE7\xE3o" }),
|
|
3510
3580
|
/* @__PURE__ */ jsx14(
|
|
3511
3581
|
Input9,
|
|
3512
3582
|
{
|
|
3583
|
+
id: "edit-cred-expires",
|
|
3584
|
+
name: "expires",
|
|
3513
3585
|
type: "date",
|
|
3514
3586
|
value: editForm.expires_at,
|
|
3515
3587
|
onChange: (e) => setEditForm((f) => ({ ...f, expires_at: e.target.value }))
|
|
@@ -3517,7 +3589,7 @@ function ToolCredentialsForm({
|
|
|
3517
3589
|
)
|
|
3518
3590
|
] }),
|
|
3519
3591
|
/* @__PURE__ */ jsxs12("div", { children: [
|
|
3520
|
-
/* @__PURE__ */ jsx14("label", { className: "mb-1 block text-sm font-medium", children: "Status" }),
|
|
3592
|
+
/* @__PURE__ */ jsx14("label", { htmlFor: "edit-cred-status", className: "mb-1 block text-sm font-medium", children: "Status" }),
|
|
3521
3593
|
/* @__PURE__ */ jsxs12(
|
|
3522
3594
|
Select3,
|
|
3523
3595
|
{
|
|
@@ -3527,7 +3599,7 @@ function ToolCredentialsForm({
|
|
|
3527
3599
|
status: val
|
|
3528
3600
|
})),
|
|
3529
3601
|
children: [
|
|
3530
|
-
/* @__PURE__ */ jsx14(SelectTrigger3, { children: /* @__PURE__ */ jsx14(SelectValue3, {}) }),
|
|
3602
|
+
/* @__PURE__ */ jsx14(SelectTrigger3, { id: "edit-cred-status", children: /* @__PURE__ */ jsx14(SelectValue3, {}) }),
|
|
3531
3603
|
/* @__PURE__ */ jsxs12(SelectContent3, { children: [
|
|
3532
3604
|
/* @__PURE__ */ jsx14(SelectItem3, { value: "active", children: "Ativo" }),
|
|
3533
3605
|
/* @__PURE__ */ jsx14(SelectItem3, { value: "expired", children: "Expirado" })
|
|
@@ -3644,7 +3716,7 @@ function AgentDetailPage({
|
|
|
3644
3716
|
] })
|
|
3645
3717
|
] });
|
|
3646
3718
|
}
|
|
3647
|
-
return /* @__PURE__ */ jsxs14("div", { className: "flex flex-col gap-6 p-4", children: [
|
|
3719
|
+
return /* @__PURE__ */ jsxs14("div", { className: "flex flex-col gap-6 p-4 md:p-6", children: [
|
|
3648
3720
|
/* @__PURE__ */ jsx16("div", { className: "rounded-lg border p-4 md:p-6", children: /* @__PURE__ */ jsxs14("div", { className: "flex flex-col gap-4 md:flex-row md:items-start md:gap-6", children: [
|
|
3649
3721
|
/* @__PURE__ */ jsxs14("div", { className: "flex items-start gap-3 flex-1", children: [
|
|
3650
3722
|
onBack && /* @__PURE__ */ jsx16(
|
|
@@ -3652,6 +3724,7 @@ function AgentDetailPage({
|
|
|
3652
3724
|
{
|
|
3653
3725
|
variant: "ghost",
|
|
3654
3726
|
size: "icon",
|
|
3727
|
+
"aria-label": "Voltar",
|
|
3655
3728
|
className: "shrink-0 mt-1",
|
|
3656
3729
|
onClick: onBack,
|
|
3657
3730
|
children: /* @__PURE__ */ jsx16(ArrowLeft, { className: "h-4 w-4" })
|