@greatapps/greatagents-ui 0.3.25 → 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
@@ -2404,16 +2404,11 @@ import { useState as useState8, useMemo as useMemo6 } from "react";
2404
2404
  import {
2405
2405
  Button as Button7,
2406
2406
  Badge as Badge3,
2407
- Skeleton as Skeleton2,
2408
- Dialog,
2409
- DialogContent,
2410
- DialogHeader,
2411
- DialogTitle
2407
+ Skeleton as Skeleton2
2412
2408
  } from "@greatapps/greatauth-ui/ui";
2413
- import { FileText, RotateCcw, X, AlertTriangle } from "lucide-react";
2409
+ import { FileText, RotateCcw, X } from "lucide-react";
2414
2410
  import { toast as toast6 } from "sonner";
2415
- import { Fragment as Fragment3, jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
2416
- var STRUCTURED_MARKERS = ["[IDENTIDADE]", "[MISS\xC3O]", "[TOM, ESTILO & FORMATO]"];
2411
+ import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
2417
2412
  function formatDate(dateStr) {
2418
2413
  const date = new Date(dateStr);
2419
2414
  return date.toLocaleDateString("pt-BR", {
@@ -2489,14 +2484,9 @@ ${agent.context.trim()}`);
2489
2484
  }
2490
2485
  return sections.join("\n\n");
2491
2486
  }
2492
- function isLegacyVersion(version) {
2493
- const content = version.prompt_content ?? "";
2494
- return !STRUCTURED_MARKERS.some((marker) => content.includes(marker));
2495
- }
2496
2487
  function AgentRevisionTab({ agent, config }) {
2497
2488
  const { data: versionsData, isLoading } = usePromptVersions(config, agent.id);
2498
2489
  const [compareVersionId, setCompareVersionId] = useState8(null);
2499
- const [legacyModalVersion, setLegacyModalVersion] = useState8(null);
2500
2490
  const versions = versionsData?.data || [];
2501
2491
  const sortedVersions = [...versions].sort(
2502
2492
  (a, b) => new Date(b.datetime_add).getTime() - new Date(a.datetime_add).getTime()
@@ -2514,12 +2504,8 @@ function AgentRevisionTab({ agent, config }) {
2514
2504
  const tokenEstimate = Math.ceil(charCount / 4);
2515
2505
  const compareVersion = sortedVersions.find((v) => v.id === compareVersionId);
2516
2506
  const diffLines = currentVersion && compareVersion && compareVersion.id !== currentVersion.id ? computeDiff(compareVersion.prompt_content ?? "", currentVersion.prompt_content ?? "") : null;
2517
- function handleRestore(version) {
2518
- if (isLegacyVersion(version)) {
2519
- setLegacyModalVersion(version);
2520
- } else {
2521
- toast6.info("Restaurar vers\xE3o estruturada \u2014 funcionalidade em desenvolvimento");
2522
- }
2507
+ function handleRestore(_version) {
2508
+ toast6.info("Restaurar vers\xE3o \u2014 funcionalidade em desenvolvimento");
2523
2509
  }
2524
2510
  if (isLoading) {
2525
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)) });
@@ -2652,38 +2638,7 @@ function AgentRevisionTab({ agent, config }) {
2652
2638
  version.id
2653
2639
  );
2654
2640
  }) })
2655
- ] }),
2656
- /* @__PURE__ */ jsx8(
2657
- Dialog,
2658
- {
2659
- open: !!legacyModalVersion,
2660
- onOpenChange: (open) => {
2661
- if (!open) setLegacyModalVersion(null);
2662
- },
2663
- children: /* @__PURE__ */ jsxs7(DialogContent, { className: "max-w-2xl", children: [
2664
- /* @__PURE__ */ jsx8(DialogHeader, { children: /* @__PURE__ */ jsxs7(DialogTitle, { className: "flex items-center gap-2", children: [
2665
- /* @__PURE__ */ jsx8(AlertTriangle, { className: "h-5 w-5 text-amber-500" }),
2666
- "Vers\xE3o Legada \u2014 v",
2667
- legacyModalVersion?.version_number
2668
- ] }) }),
2669
- /* @__PURE__ */ jsxs7("div", { className: "space-y-3", children: [
2670
- /* @__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." }) }),
2671
- /* @__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 ?? "" }) }),
2672
- /* @__PURE__ */ jsxs7("div", { className: "flex items-center gap-3 text-xs text-muted-foreground", children: [
2673
- /* @__PURE__ */ jsxs7("span", { children: [
2674
- (legacyModalVersion?.prompt_content ?? "").length.toLocaleString("pt-BR"),
2675
- " caracteres"
2676
- ] }),
2677
- legacyModalVersion?.change_notes && /* @__PURE__ */ jsxs7(Fragment3, { children: [
2678
- /* @__PURE__ */ jsx8("span", { children: "\xB7" }),
2679
- /* @__PURE__ */ jsx8("span", { className: "italic", children: legacyModalVersion.change_notes })
2680
- ] })
2681
- ] })
2682
- ] }),
2683
- /* @__PURE__ */ jsx8("div", { className: "flex justify-end pt-2", children: /* @__PURE__ */ jsx8(Button7, { variant: "outline", onClick: () => setLegacyModalVersion(null), children: "Fechar" }) })
2684
- ] })
2685
- }
2686
- )
2641
+ ] })
2687
2642
  ] });
2688
2643
  }
2689
2644
 
@@ -4127,7 +4082,7 @@ import { Pencil as Pencil5, Trash2 as Trash25, Search as Search2 } from "lucide-
4127
4082
  import { format as format2 } from "date-fns";
4128
4083
  import { ptBR as ptBR2 } from "date-fns/locale";
4129
4084
  import { toast as toast10 } from "sonner";
4130
- import { Fragment as Fragment4, jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
4085
+ import { Fragment as Fragment3, jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
4131
4086
  function useColumns2(onEdit, onDelete) {
4132
4087
  return [
4133
4088
  {
@@ -4236,7 +4191,7 @@ function ToolsTable({ onEdit, config }) {
4236
4191
  setSearch(value);
4237
4192
  setPage(1);
4238
4193
  }
4239
- return /* @__PURE__ */ jsxs14(Fragment4, { children: [
4194
+ return /* @__PURE__ */ jsxs14(Fragment3, { children: [
4240
4195
  /* @__PURE__ */ jsx16("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ jsxs14("div", { className: "relative flex-1 max-w-md", children: [
4241
4196
  /* @__PURE__ */ jsx16(Search2, { "aria-hidden": "true", className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
4242
4197
  /* @__PURE__ */ jsx16(
@@ -4785,7 +4740,7 @@ import {
4785
4740
  Unplug,
4786
4741
  Trash2 as Trash27
4787
4742
  } from "lucide-react";
4788
- import { Fragment as Fragment5, jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
4743
+ import { Fragment as Fragment4, jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
4789
4744
  var ICON_MAP2 = {
4790
4745
  CalendarSync: CalendarSync2,
4791
4746
  Plug: Plug3,
@@ -4891,7 +4846,7 @@ function IntegrationCard({
4891
4846
  );
4892
4847
  }
4893
4848
  const badge = STATE_BADGES[state];
4894
- return /* @__PURE__ */ jsxs17(Fragment5, { children: [
4849
+ return /* @__PURE__ */ jsxs17(Fragment4, { children: [
4895
4850
  /* @__PURE__ */ jsxs17(
4896
4851
  "div",
4897
4852
  {
@@ -5033,11 +4988,11 @@ function AdvancedTab({ config, agentId, gagentsApiUrl }) {
5033
4988
  // src/components/capabilities/integration-wizard.tsx
5034
4989
  import { useCallback as useCallback7, useEffect as useEffect6, useRef as useRef3, useState as useState18 } from "react";
5035
4990
  import {
5036
- Dialog as Dialog2,
5037
- DialogContent as DialogContent2,
4991
+ Dialog,
4992
+ DialogContent,
5038
4993
  DialogFooter,
5039
- DialogHeader as DialogHeader2,
5040
- DialogTitle as DialogTitle2,
4994
+ DialogHeader,
4995
+ DialogTitle,
5041
4996
  Button as Button17
5042
4997
  } from "@greatapps/greatauth-ui/ui";
5043
4998
  import { Loader2 as Loader29, ChevronLeft, ChevronRight, Check as Check2 } from "lucide-react";
@@ -5625,8 +5580,8 @@ function IntegrationWizard({
5625
5580
  const selectedConfigOption = configOptions.find((o) => o.id === selectedConfigValue) || null;
5626
5581
  const isLastStep = currentStep === "confirm";
5627
5582
  const effectiveSteps = meta.hasConfigStep ? STEPS : STEPS.filter((s) => s !== "config");
5628
- return /* @__PURE__ */ jsx25(Dialog2, { open, onOpenChange, children: /* @__PURE__ */ jsxs23(DialogContent2, { className: "sm:max-w-lg", children: [
5629
- /* @__PURE__ */ jsx25(DialogHeader2, { children: /* @__PURE__ */ jsx25(DialogTitle2, { 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 }) }),
5630
5585
  /* @__PURE__ */ jsx25(StepIndicator, { steps: effectiveSteps, currentStep }),
5631
5586
  /* @__PURE__ */ jsxs23("div", { className: "min-h-[280px] py-2", children: [
5632
5587
  currentStep === "info" && /* @__PURE__ */ jsx25(