@greatapps/greatagents-ui 0.3.24 → 0.3.26

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 CHANGED
@@ -978,7 +978,7 @@ import {
978
978
  import { Loader2 as Loader22 } from "lucide-react";
979
979
  import { toast as toast3 } from "sonner";
980
980
  import { ImageCropUpload as ImageCropUpload2 } from "@greatapps/greatauth-ui";
981
- import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
981
+ import { Fragment as Fragment2, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
982
982
  function msToSeconds2(ms) {
983
983
  if (ms == null || ms === 0) return "";
984
984
  return String(Math.round(ms / 1e3));
@@ -1033,7 +1033,7 @@ function AgentEditForm({ config, agent, idAccount, open, onOpenChange }) {
1033
1033
  toast3.error("Erro ao atualizar agente");
1034
1034
  }
1035
1035
  }
1036
- const formContent = /* @__PURE__ */ jsxs3("form", { onSubmit: handleSubmit, className: "space-y-4", children: [
1036
+ const formFields = /* @__PURE__ */ jsxs3(Fragment2, { children: [
1037
1037
  /* @__PURE__ */ jsx3("div", { className: "flex justify-center", children: /* @__PURE__ */ jsx3(
1038
1038
  ImageCropUpload2,
1039
1039
  {
@@ -1117,8 +1117,35 @@ function AgentEditForm({ config, agent, idAccount, open, onOpenChange }) {
1117
1117
  ),
1118
1118
  /* @__PURE__ */ jsx3("p", { className: "text-xs text-muted-foreground", children: "Espera por mensagens agrupadas" })
1119
1119
  ] })
1120
- ] }),
1121
- /* @__PURE__ */ jsxs3(SheetFooter2, { children: [
1120
+ ] })
1121
+ ] });
1122
+ if (open !== void 0 && onOpenChange) {
1123
+ return /* @__PURE__ */ jsx3(Sheet2, { open, onOpenChange, children: /* @__PURE__ */ jsxs3(SheetContent2, { className: "sm:max-w-md", children: [
1124
+ /* @__PURE__ */ jsx3(SheetHeader2, { children: /* @__PURE__ */ jsx3(SheetTitle2, { children: "Editar Agente" }) }),
1125
+ /* @__PURE__ */ jsxs3("form", { onSubmit: handleSubmit, className: "flex flex-1 flex-col overflow-hidden", children: [
1126
+ /* @__PURE__ */ jsx3("div", { className: "flex-1 overflow-y-auto px-4 space-y-4", children: formFields }),
1127
+ /* @__PURE__ */ jsxs3(SheetFooter2, { className: "flex-row justify-end border-t", children: [
1128
+ /* @__PURE__ */ jsx3(
1129
+ Button3,
1130
+ {
1131
+ type: "button",
1132
+ variant: "outline",
1133
+ onClick: () => onOpenChange?.(false),
1134
+ disabled: updateAgent.isPending,
1135
+ children: "Cancelar"
1136
+ }
1137
+ ),
1138
+ /* @__PURE__ */ jsxs3(Button3, { type: "submit", disabled: updateAgent.isPending, children: [
1139
+ updateAgent.isPending && /* @__PURE__ */ jsx3(Loader22, { "aria-hidden": "true", className: "mr-2 h-4 w-4 animate-spin" }),
1140
+ "Salvar"
1141
+ ] })
1142
+ ] })
1143
+ ] })
1144
+ ] }) });
1145
+ }
1146
+ return /* @__PURE__ */ jsx3("div", { className: "max-w-lg pt-4", children: /* @__PURE__ */ jsxs3("form", { onSubmit: handleSubmit, className: "space-y-4", children: [
1147
+ formFields,
1148
+ /* @__PURE__ */ jsxs3("div", { className: "flex justify-end gap-2 pt-4 border-t", children: [
1122
1149
  /* @__PURE__ */ jsx3(
1123
1150
  Button3,
1124
1151
  {
@@ -1134,14 +1161,7 @@ function AgentEditForm({ config, agent, idAccount, open, onOpenChange }) {
1134
1161
  "Salvar"
1135
1162
  ] })
1136
1163
  ] })
1137
- ] });
1138
- if (open !== void 0 && onOpenChange) {
1139
- return /* @__PURE__ */ jsx3(Sheet2, { open, onOpenChange, children: /* @__PURE__ */ jsxs3(SheetContent2, { className: "sm:max-w-md overflow-y-auto", children: [
1140
- /* @__PURE__ */ jsx3(SheetHeader2, { children: /* @__PURE__ */ jsx3(SheetTitle2, { children: "Editar Agente" }) }),
1141
- formContent
1142
- ] }) });
1143
- }
1144
- return /* @__PURE__ */ jsx3("div", { className: "max-w-lg pt-4", children: formContent });
1164
+ ] }) });
1145
1165
  }
1146
1166
 
1147
1167
  // src/components/agents/agent-objectives-list.tsx
@@ -2384,16 +2404,11 @@ import { useState as useState8, useMemo as useMemo6 } from "react";
2384
2404
  import {
2385
2405
  Button as Button7,
2386
2406
  Badge as Badge3,
2387
- Skeleton as Skeleton2,
2388
- Dialog,
2389
- DialogContent,
2390
- DialogHeader,
2391
- DialogTitle
2407
+ Skeleton as Skeleton2
2392
2408
  } from "@greatapps/greatauth-ui/ui";
2393
- import { FileText, RotateCcw, X, AlertTriangle } from "lucide-react";
2409
+ import { FileText, RotateCcw, X } from "lucide-react";
2394
2410
  import { toast as toast6 } from "sonner";
2395
- import { Fragment as Fragment2, jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
2396
- var STRUCTURED_MARKERS = ["[IDENTIDADE]", "[MISS\xC3O]", "[TOM, ESTILO & FORMATO]"];
2411
+ import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
2397
2412
  function formatDate(dateStr) {
2398
2413
  const date = new Date(dateStr);
2399
2414
  return date.toLocaleDateString("pt-BR", {
@@ -2469,14 +2484,9 @@ ${agent.context.trim()}`);
2469
2484
  }
2470
2485
  return sections.join("\n\n");
2471
2486
  }
2472
- function isLegacyVersion(version) {
2473
- const content = version.prompt_content ?? "";
2474
- return !STRUCTURED_MARKERS.some((marker) => content.includes(marker));
2475
- }
2476
2487
  function AgentRevisionTab({ agent, config }) {
2477
2488
  const { data: versionsData, isLoading } = usePromptVersions(config, agent.id);
2478
2489
  const [compareVersionId, setCompareVersionId] = useState8(null);
2479
- const [legacyModalVersion, setLegacyModalVersion] = useState8(null);
2480
2490
  const versions = versionsData?.data || [];
2481
2491
  const sortedVersions = [...versions].sort(
2482
2492
  (a, b) => new Date(b.datetime_add).getTime() - new Date(a.datetime_add).getTime()
@@ -2494,12 +2504,8 @@ function AgentRevisionTab({ agent, config }) {
2494
2504
  const tokenEstimate = Math.ceil(charCount / 4);
2495
2505
  const compareVersion = sortedVersions.find((v) => v.id === compareVersionId);
2496
2506
  const diffLines = currentVersion && compareVersion && compareVersion.id !== currentVersion.id ? computeDiff(compareVersion.prompt_content ?? "", currentVersion.prompt_content ?? "") : null;
2497
- function handleRestore(version) {
2498
- if (isLegacyVersion(version)) {
2499
- setLegacyModalVersion(version);
2500
- } else {
2501
- toast6.info("Restaurar vers\xE3o estruturada \u2014 funcionalidade em desenvolvimento");
2502
- }
2507
+ function handleRestore(_version) {
2508
+ toast6.info("Restaurar vers\xE3o \u2014 funcionalidade em desenvolvimento");
2503
2509
  }
2504
2510
  if (isLoading) {
2505
2511
  return /* @__PURE__ */ jsx8("div", { className: "space-y-3 p-4", children: Array.from({ length: 3 }).map((_, i) => /* @__PURE__ */ jsx8(Skeleton2, { className: "h-14 w-full" }, i)) });
@@ -2632,38 +2638,7 @@ function AgentRevisionTab({ agent, config }) {
2632
2638
  version.id
2633
2639
  );
2634
2640
  }) })
2635
- ] }),
2636
- /* @__PURE__ */ jsx8(
2637
- Dialog,
2638
- {
2639
- open: !!legacyModalVersion,
2640
- onOpenChange: (open) => {
2641
- if (!open) setLegacyModalVersion(null);
2642
- },
2643
- children: /* @__PURE__ */ jsxs7(DialogContent, { className: "max-w-2xl", children: [
2644
- /* @__PURE__ */ jsx8(DialogHeader, { children: /* @__PURE__ */ jsxs7(DialogTitle, { className: "flex items-center gap-2", children: [
2645
- /* @__PURE__ */ jsx8(AlertTriangle, { className: "h-5 w-5 text-amber-500" }),
2646
- "Vers\xE3o Legada \u2014 v",
2647
- legacyModalVersion?.version_number
2648
- ] }) }),
2649
- /* @__PURE__ */ jsxs7("div", { className: "space-y-3", children: [
2650
- /* @__PURE__ */ jsx8("div", { className: "rounded-lg border border-amber-500/30 bg-amber-500/5 p-3", children: /* @__PURE__ */ jsx8("p", { className: "text-sm text-amber-700 dark:text-amber-400", children: "Esta vers\xE3o foi criada antes da reestrutura\xE7\xE3o e n\xE3o pode ser restaurada nos campos estruturados." }) }),
2651
- /* @__PURE__ */ jsx8("div", { className: "max-h-96 overflow-auto rounded-lg border p-4", children: /* @__PURE__ */ jsx8("pre", { className: "whitespace-pre-wrap font-mono text-sm leading-relaxed", children: legacyModalVersion?.prompt_content ?? "" }) }),
2652
- /* @__PURE__ */ jsxs7("div", { className: "flex items-center gap-3 text-xs text-muted-foreground", children: [
2653
- /* @__PURE__ */ jsxs7("span", { children: [
2654
- (legacyModalVersion?.prompt_content ?? "").length.toLocaleString("pt-BR"),
2655
- " caracteres"
2656
- ] }),
2657
- legacyModalVersion?.change_notes && /* @__PURE__ */ jsxs7(Fragment2, { children: [
2658
- /* @__PURE__ */ jsx8("span", { children: "\xB7" }),
2659
- /* @__PURE__ */ jsx8("span", { className: "italic", children: legacyModalVersion.change_notes })
2660
- ] })
2661
- ] })
2662
- ] }),
2663
- /* @__PURE__ */ jsx8("div", { className: "flex justify-end pt-2", children: /* @__PURE__ */ jsx8(Button7, { variant: "outline", onClick: () => setLegacyModalVersion(null), children: "Fechar" }) })
2664
- ] })
2665
- }
2666
- )
2641
+ ] })
2667
2642
  ] });
2668
2643
  }
2669
2644
 
@@ -3775,11 +3750,11 @@ import {
3775
3750
  PopoverTrigger,
3776
3751
  Input as Input5,
3777
3752
  Textarea as Textarea3,
3778
- Dialog as Dialog2,
3779
- DialogContent as DialogContent2,
3780
- DialogHeader as DialogHeader2,
3781
- DialogTitle as DialogTitle2,
3782
- DialogFooter,
3753
+ Sheet as Sheet4,
3754
+ SheetContent as SheetContent4,
3755
+ SheetHeader as SheetHeader4,
3756
+ SheetTitle as SheetTitle4,
3757
+ SheetFooter as SheetFooter4,
3783
3758
  Label as Label5,
3784
3759
  Select,
3785
3760
  SelectContent,
@@ -3995,13 +3970,13 @@ function AgentToolsList({ agent, config }) {
3995
3970
  );
3996
3971
  }) }),
3997
3972
  /* @__PURE__ */ jsx15(
3998
- Dialog2,
3973
+ Sheet4,
3999
3974
  {
4000
3975
  open: !!configTarget,
4001
3976
  onOpenChange: (open) => !open && setConfigTarget(null),
4002
- children: /* @__PURE__ */ jsxs13(DialogContent2, { className: "sm:max-w-lg", children: [
4003
- /* @__PURE__ */ jsx15(DialogHeader2, { children: /* @__PURE__ */ jsx15(DialogTitle2, { children: "Instru\xE7\xF5es da Ferramenta" }) }),
4004
- /* @__PURE__ */ jsxs13("div", { className: "space-y-4", children: [
3977
+ children: /* @__PURE__ */ jsxs13(SheetContent4, { className: "sm:max-w-lg", children: [
3978
+ /* @__PURE__ */ jsx15(SheetHeader4, { children: /* @__PURE__ */ jsx15(SheetTitle4, { children: "Instru\xE7\xF5es da Ferramenta" }) }),
3979
+ /* @__PURE__ */ jsxs13("div", { className: "flex-1 overflow-y-auto px-4 space-y-4", children: [
4005
3980
  configTarget && getToolInfo(configTarget.id_tool)?.type !== "none" && /* @__PURE__ */ jsxs13("div", { className: "space-y-2", children: [
4006
3981
  /* @__PURE__ */ jsx15(Label5, { htmlFor: "tool-credential", children: "Credencial" }),
4007
3982
  /* @__PURE__ */ jsxs13(
@@ -4036,7 +4011,7 @@ function AgentToolsList({ agent, config }) {
4036
4011
  /* @__PURE__ */ jsx15("p", { className: "text-xs text-muted-foreground", children: "Este texto \xE9 adicionado ao prompt do agente para orientar o uso da ferramenta." })
4037
4012
  ] })
4038
4013
  ] }),
4039
- /* @__PURE__ */ jsxs13(DialogFooter, { children: [
4014
+ /* @__PURE__ */ jsxs13(SheetFooter4, { className: "flex-row justify-end border-t", children: [
4040
4015
  /* @__PURE__ */ jsx15(
4041
4016
  Button11,
4042
4017
  {
@@ -4277,11 +4252,11 @@ function ToolsTable({ onEdit, config }) {
4277
4252
  // src/components/tools/tool-form-dialog.tsx
4278
4253
  import { useState as useState14 } from "react";
4279
4254
  import {
4280
- Dialog as Dialog3,
4281
- DialogContent as DialogContent3,
4282
- DialogHeader as DialogHeader3,
4283
- DialogTitle as DialogTitle3,
4284
- DialogFooter as DialogFooter2,
4255
+ Sheet as Sheet5,
4256
+ SheetContent as SheetContent5,
4257
+ SheetHeader as SheetHeader5,
4258
+ SheetTitle as SheetTitle5,
4259
+ SheetFooter as SheetFooter5,
4285
4260
  Button as Button13,
4286
4261
  Input as Input7,
4287
4262
  Textarea as Textarea4,
@@ -4404,109 +4379,110 @@ function ToolFormDialog({
4404
4379
  );
4405
4380
  }
4406
4381
  }
4407
- return /* @__PURE__ */ jsx17(Dialog3, { open, onOpenChange, children: /* @__PURE__ */ jsxs15(DialogContent3, { className: "sm:max-w-lg", children: [
4408
- /* @__PURE__ */ jsx17(DialogHeader3, { children: /* @__PURE__ */ jsx17(DialogTitle3, { children: isEditing ? "Editar Ferramenta" : "Nova Ferramenta" }) }),
4409
- /* @__PURE__ */ jsxs15("form", { onSubmit: handleSubmit, className: "space-y-4", children: [
4410
- /* @__PURE__ */ jsxs15("div", { className: "space-y-2", children: [
4411
- /* @__PURE__ */ jsx17(Label6, { htmlFor: "tool-name", children: "Nome *" }),
4412
- /* @__PURE__ */ jsx17(
4413
- Input7,
4414
- {
4415
- id: "tool-name",
4416
- name: "name",
4417
- value: form.name,
4418
- onChange: (e) => {
4419
- const name = e.target.value;
4420
- setForm((prev) => ({
4421
- ...prev,
4422
- name,
4423
- nameError: name.trim() ? false : prev.nameError,
4424
- ...!slugManuallyEdited && !isEditing ? { slug: slugify2(name), slugError: false } : {}
4425
- }));
4426
- },
4427
- placeholder: "Ex: Google Calendar",
4428
- disabled: isPending
4429
- }
4430
- ),
4431
- form.nameError && /* @__PURE__ */ jsx17("p", { className: "text-sm text-destructive", children: "Nome \xE9 obrigat\xF3rio" })
4432
- ] }),
4433
- /* @__PURE__ */ jsxs15("div", { className: "space-y-2", children: [
4434
- /* @__PURE__ */ jsx17(Label6, { htmlFor: "tool-slug", children: "Slug (identificador \xFAnico) *" }),
4435
- /* @__PURE__ */ jsx17(
4436
- Input7,
4437
- {
4438
- id: "tool-slug",
4439
- name: "slug",
4440
- value: form.slug,
4441
- onChange: (e) => {
4442
- setSlugManuallyEdited(true);
4443
- setForm((prev) => ({
4444
- ...prev,
4445
- slug: e.target.value,
4446
- slugError: e.target.value.trim() ? false : prev.slugError
4447
- }));
4448
- },
4449
- placeholder: "Ex: google-calendar",
4450
- disabled: isPending
4451
- }
4452
- ),
4453
- /* @__PURE__ */ jsx17("p", { className: "text-xs text-muted-foreground", children: "Gerado automaticamente a partir do nome. Usado internamente para identificar a ferramenta." }),
4454
- form.slugError && /* @__PURE__ */ jsx17("p", { className: "text-sm text-destructive", children: "Slug \xE9 obrigat\xF3rio" })
4455
- ] }),
4456
- /* @__PURE__ */ jsxs15("div", { className: "space-y-2", children: [
4457
- /* @__PURE__ */ jsx17(Label6, { htmlFor: "tool-type", children: "Tipo de Autentica\xE7\xE3o *" }),
4458
- /* @__PURE__ */ jsxs15(
4459
- Select2,
4460
- {
4461
- value: form.type,
4462
- onValueChange: (value) => {
4463
- setForm((prev) => ({
4464
- ...prev,
4465
- type: value,
4466
- typeError: false
4467
- }));
4468
- },
4469
- disabled: isPending,
4470
- children: [
4471
- /* @__PURE__ */ jsx17(SelectTrigger2, { id: "tool-type", children: /* @__PURE__ */ jsx17(SelectValue2, { placeholder: "Selecione o tipo" }) }),
4472
- /* @__PURE__ */ jsx17(SelectContent2, { children: TOOL_AUTH_TYPES.map((t) => /* @__PURE__ */ jsx17(SelectItem2, { value: t.value, children: t.label }, t.value)) })
4473
- ]
4474
- }
4475
- ),
4476
- /* @__PURE__ */ jsx17("p", { className: "text-xs text-muted-foreground", children: "Define se a ferramenta requer credenciais para funcionar." }),
4477
- form.typeError && /* @__PURE__ */ jsx17("p", { className: "text-sm text-destructive", children: "Tipo \xE9 obrigat\xF3rio" })
4478
- ] }),
4479
- /* @__PURE__ */ jsxs15("div", { className: "space-y-2", children: [
4480
- /* @__PURE__ */ jsx17(Label6, { htmlFor: "tool-description", children: "Descri\xE7\xE3o" }),
4481
- /* @__PURE__ */ jsx17(
4482
- Textarea4,
4483
- {
4484
- id: "tool-description",
4485
- name: "description",
4486
- value: form.description,
4487
- onChange: (e) => setForm((prev) => ({ ...prev, description: e.target.value })),
4488
- placeholder: "Descri\\u00e7\\u00e3o da ferramenta\\u2026",
4489
- rows: 3,
4490
- disabled: isPending
4491
- }
4492
- )
4493
- ] }),
4494
- /* @__PURE__ */ jsxs15("div", { className: "space-y-2", children: [
4495
- /* @__PURE__ */ jsx17(Label6, { htmlFor: "tool-function-defs", children: "Defini\xE7\xF5es de Fun\xE7\xE3o (JSON)" }),
4496
- /* @__PURE__ */ jsx17(
4497
- Textarea4,
4498
- {
4499
- id: "tool-function-defs",
4500
- name: "functionDefs",
4501
- value: form.functionDefinitions,
4502
- onChange: (e) => {
4503
- setForm((prev) => ({
4504
- ...prev,
4505
- functionDefinitions: e.target.value,
4506
- jsonError: false
4507
- }));
4508
- },
4509
- placeholder: `[
4382
+ return /* @__PURE__ */ jsx17(Sheet5, { open, onOpenChange, children: /* @__PURE__ */ jsxs15(SheetContent5, { className: "sm:max-w-lg", children: [
4383
+ /* @__PURE__ */ jsx17(SheetHeader5, { children: /* @__PURE__ */ jsx17(SheetTitle5, { children: isEditing ? "Editar Ferramenta" : "Nova Ferramenta" }) }),
4384
+ /* @__PURE__ */ jsxs15("form", { onSubmit: handleSubmit, className: "flex flex-1 flex-col overflow-hidden", children: [
4385
+ /* @__PURE__ */ jsxs15("div", { className: "flex-1 overflow-y-auto px-4 space-y-4", children: [
4386
+ /* @__PURE__ */ jsxs15("div", { className: "space-y-2", children: [
4387
+ /* @__PURE__ */ jsx17(Label6, { htmlFor: "tool-name", children: "Nome *" }),
4388
+ /* @__PURE__ */ jsx17(
4389
+ Input7,
4390
+ {
4391
+ id: "tool-name",
4392
+ name: "name",
4393
+ value: form.name,
4394
+ onChange: (e) => {
4395
+ const name = e.target.value;
4396
+ setForm((prev) => ({
4397
+ ...prev,
4398
+ name,
4399
+ nameError: name.trim() ? false : prev.nameError,
4400
+ ...!slugManuallyEdited && !isEditing ? { slug: slugify2(name), slugError: false } : {}
4401
+ }));
4402
+ },
4403
+ placeholder: "Ex: Google Calendar",
4404
+ disabled: isPending
4405
+ }
4406
+ ),
4407
+ form.nameError && /* @__PURE__ */ jsx17("p", { className: "text-sm text-destructive", children: "Nome \xE9 obrigat\xF3rio" })
4408
+ ] }),
4409
+ /* @__PURE__ */ jsxs15("div", { className: "space-y-2", children: [
4410
+ /* @__PURE__ */ jsx17(Label6, { htmlFor: "tool-slug", children: "Slug (identificador \xFAnico) *" }),
4411
+ /* @__PURE__ */ jsx17(
4412
+ Input7,
4413
+ {
4414
+ id: "tool-slug",
4415
+ name: "slug",
4416
+ value: form.slug,
4417
+ onChange: (e) => {
4418
+ setSlugManuallyEdited(true);
4419
+ setForm((prev) => ({
4420
+ ...prev,
4421
+ slug: e.target.value,
4422
+ slugError: e.target.value.trim() ? false : prev.slugError
4423
+ }));
4424
+ },
4425
+ placeholder: "Ex: google-calendar",
4426
+ disabled: isPending
4427
+ }
4428
+ ),
4429
+ /* @__PURE__ */ jsx17("p", { className: "text-xs text-muted-foreground", children: "Gerado automaticamente a partir do nome. Usado internamente para identificar a ferramenta." }),
4430
+ form.slugError && /* @__PURE__ */ jsx17("p", { className: "text-sm text-destructive", children: "Slug \xE9 obrigat\xF3rio" })
4431
+ ] }),
4432
+ /* @__PURE__ */ jsxs15("div", { className: "space-y-2", children: [
4433
+ /* @__PURE__ */ jsx17(Label6, { htmlFor: "tool-type", children: "Tipo de Autentica\xE7\xE3o *" }),
4434
+ /* @__PURE__ */ jsxs15(
4435
+ Select2,
4436
+ {
4437
+ value: form.type,
4438
+ onValueChange: (value) => {
4439
+ setForm((prev) => ({
4440
+ ...prev,
4441
+ type: value,
4442
+ typeError: false
4443
+ }));
4444
+ },
4445
+ disabled: isPending,
4446
+ children: [
4447
+ /* @__PURE__ */ jsx17(SelectTrigger2, { id: "tool-type", children: /* @__PURE__ */ jsx17(SelectValue2, { placeholder: "Selecione o tipo" }) }),
4448
+ /* @__PURE__ */ jsx17(SelectContent2, { children: TOOL_AUTH_TYPES.map((t) => /* @__PURE__ */ jsx17(SelectItem2, { value: t.value, children: t.label }, t.value)) })
4449
+ ]
4450
+ }
4451
+ ),
4452
+ /* @__PURE__ */ jsx17("p", { className: "text-xs text-muted-foreground", children: "Define se a ferramenta requer credenciais para funcionar." }),
4453
+ form.typeError && /* @__PURE__ */ jsx17("p", { className: "text-sm text-destructive", children: "Tipo \xE9 obrigat\xF3rio" })
4454
+ ] }),
4455
+ /* @__PURE__ */ jsxs15("div", { className: "space-y-2", children: [
4456
+ /* @__PURE__ */ jsx17(Label6, { htmlFor: "tool-description", children: "Descri\xE7\xE3o" }),
4457
+ /* @__PURE__ */ jsx17(
4458
+ Textarea4,
4459
+ {
4460
+ id: "tool-description",
4461
+ name: "description",
4462
+ value: form.description,
4463
+ onChange: (e) => setForm((prev) => ({ ...prev, description: e.target.value })),
4464
+ placeholder: "Descri\\u00e7\\u00e3o da ferramenta\\u2026",
4465
+ rows: 3,
4466
+ disabled: isPending
4467
+ }
4468
+ )
4469
+ ] }),
4470
+ /* @__PURE__ */ jsxs15("div", { className: "space-y-2", children: [
4471
+ /* @__PURE__ */ jsx17(Label6, { htmlFor: "tool-function-defs", children: "Defini\xE7\xF5es de Fun\xE7\xE3o (JSON)" }),
4472
+ /* @__PURE__ */ jsx17(
4473
+ Textarea4,
4474
+ {
4475
+ id: "tool-function-defs",
4476
+ name: "functionDefs",
4477
+ value: form.functionDefinitions,
4478
+ onChange: (e) => {
4479
+ setForm((prev) => ({
4480
+ ...prev,
4481
+ functionDefinitions: e.target.value,
4482
+ jsonError: false
4483
+ }));
4484
+ },
4485
+ placeholder: `[
4510
4486
  {
4511
4487
  "type": "function",
4512
4488
  "function": {
@@ -4520,15 +4496,16 @@ function ToolFormDialog({
4520
4496
  }
4521
4497
  }
4522
4498
  ]`,
4523
- rows: 10,
4524
- className: "font-mono text-sm",
4525
- disabled: isPending
4526
- }
4527
- ),
4528
- /* @__PURE__ */ jsx17("p", { className: "text-xs text-muted-foreground", children: "Array de defini\xE7\xF5es no formato OpenAI Function Calling." }),
4529
- form.jsonError && /* @__PURE__ */ jsx17("p", { className: "text-sm text-destructive", children: "JSON inv\xE1lido" })
4499
+ rows: 10,
4500
+ className: "font-mono text-sm",
4501
+ disabled: isPending
4502
+ }
4503
+ ),
4504
+ /* @__PURE__ */ jsx17("p", { className: "text-xs text-muted-foreground", children: "Array de defini\xE7\xF5es no formato OpenAI Function Calling." }),
4505
+ form.jsonError && /* @__PURE__ */ jsx17("p", { className: "text-sm text-destructive", children: "JSON inv\xE1lido" })
4506
+ ] })
4530
4507
  ] }),
4531
- /* @__PURE__ */ jsxs15(DialogFooter2, { children: [
4508
+ /* @__PURE__ */ jsxs15(SheetFooter5, { className: "flex-row justify-end border-t", children: [
4532
4509
  /* @__PURE__ */ jsx17(
4533
4510
  Button13,
4534
4511
  {
@@ -5011,11 +4988,11 @@ function AdvancedTab({ config, agentId, gagentsApiUrl }) {
5011
4988
  // src/components/capabilities/integration-wizard.tsx
5012
4989
  import { useCallback as useCallback7, useEffect as useEffect6, useRef as useRef3, useState as useState18 } from "react";
5013
4990
  import {
5014
- Dialog as Dialog4,
5015
- DialogContent as DialogContent4,
5016
- DialogFooter as DialogFooter3,
5017
- DialogHeader as DialogHeader4,
5018
- DialogTitle as DialogTitle4,
4991
+ Dialog,
4992
+ DialogContent,
4993
+ DialogFooter,
4994
+ DialogHeader,
4995
+ DialogTitle,
5019
4996
  Button as Button17
5020
4997
  } from "@greatapps/greatauth-ui/ui";
5021
4998
  import { Loader2 as Loader29, ChevronLeft, ChevronRight, Check as Check2 } from "lucide-react";
@@ -5603,8 +5580,8 @@ function IntegrationWizard({
5603
5580
  const selectedConfigOption = configOptions.find((o) => o.id === selectedConfigValue) || null;
5604
5581
  const isLastStep = currentStep === "confirm";
5605
5582
  const effectiveSteps = meta.hasConfigStep ? STEPS : STEPS.filter((s) => s !== "config");
5606
- return /* @__PURE__ */ jsx25(Dialog4, { open, onOpenChange, children: /* @__PURE__ */ jsxs23(DialogContent4, { className: "sm:max-w-lg", children: [
5607
- /* @__PURE__ */ jsx25(DialogHeader4, { children: /* @__PURE__ */ jsx25(DialogTitle4, { children: integration.name }) }),
5583
+ return /* @__PURE__ */ jsx25(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs23(DialogContent, { className: "sm:max-w-lg", children: [
5584
+ /* @__PURE__ */ jsx25(DialogHeader, { children: /* @__PURE__ */ jsx25(DialogTitle, { children: integration.name }) }),
5608
5585
  /* @__PURE__ */ jsx25(StepIndicator, { steps: effectiveSteps, currentStep }),
5609
5586
  /* @__PURE__ */ jsxs23("div", { className: "min-h-[280px] py-2", children: [
5610
5587
  currentStep === "info" && /* @__PURE__ */ jsx25(
@@ -5648,7 +5625,7 @@ function IntegrationWizard({
5648
5625
  }
5649
5626
  )
5650
5627
  ] }),
5651
- /* @__PURE__ */ jsxs23(DialogFooter3, { className: "flex-row justify-between sm:justify-between", children: [
5628
+ /* @__PURE__ */ jsxs23(DialogFooter, { className: "flex-row justify-between sm:justify-between", children: [
5652
5629
  /* @__PURE__ */ jsx25("div", { children: currentStep === "info" ? /* @__PURE__ */ jsx25(
5653
5630
  Button17,
5654
5631
  {