Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

refactor(frontend): cleanup of `components` folder (2/3) (#10942)

Ubbef283e6c514d2
diff --git a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/1-welcome/page.tsx b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/1-welcome/page.tsx
index 350e4f0a88..ce63a591e7 100644
--- a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/1-welcome/page.tsx
+++ b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/1-welcome/page.tsx
@@ -1,8 +1,8 @@
"use client";
-import { OnboardingText } from "@/components/onboarding/OnboardingText";
-import OnboardingButton from "@/components/onboarding/OnboardingButton";
+import { OnboardingText } from "../components/OnboardingText";
+import OnboardingButton from "../components/OnboardingButton";
import Image from "next/image";
-import { useOnboarding } from "@/components/onboarding/onboarding-provider";
+import { useOnboarding } from "../../../../providers/onboarding/onboarding-provider";
export default function Page() {
useOnboarding(1);
diff --git a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/2-reason/page.tsx b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/2-reason/page.tsx
index 62a3418466..508e1f8fa0 100644
--- a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/2-reason/page.tsx
+++ b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/2-reason/page.tsx
@@ -1,14 +1,14 @@
"use client";
-import OnboardingButton from "@/components/onboarding/OnboardingButton";
+import OnboardingButton from "../components/OnboardingButton";
import {
OnboardingFooter,
OnboardingHeader,
OnboardingStep,
-} from "@/components/onboarding/OnboardingStep";
-import { OnboardingText } from "@/components/onboarding/OnboardingText";
-import OnboardingList from "@/components/onboarding/OnboardingList";
+} from "../components/OnboardingStep";
+import { OnboardingText } from "../components/OnboardingText";
+import OnboardingList from "../components/OnboardingList";
import { isEmptyOrWhitespace } from "@/lib/utils";
-import { useOnboarding } from "@/components/onboarding/onboarding-provider";
+import { useOnboarding } from "../../../../providers/onboarding/onboarding-provider";
const reasons = [
{
diff --git a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/3-services/page.tsx b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/3-services/page.tsx
index a7867aca50..5527963110 100644
--- a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/3-services/page.tsx
+++ b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/3-services/page.tsx
@@ -1,15 +1,15 @@
"use client";
-import OnboardingButton from "@/components/onboarding/OnboardingButton";
+import OnboardingButton from "../components/OnboardingButton";
import {
OnboardingStep,
OnboardingHeader,
OnboardingFooter,
-} from "@/components/onboarding/OnboardingStep";
-import { OnboardingText } from "@/components/onboarding/OnboardingText";
-import { OnboardingGrid } from "@/components/onboarding/OnboardingGrid";
+} from "../components/OnboardingStep";
+import { OnboardingText } from "../components/OnboardingText";
+import { OnboardingGrid } from "../components/OnboardingGrid";
import { useCallback } from "react";
-import OnboardingInput from "@/components/onboarding/OnboardingInput";
-import { useOnboarding } from "@/components/onboarding/onboarding-provider";
+import OnboardingInput from "../components/OnboardingInput";
+import { useOnboarding } from "../../../../providers/onboarding/onboarding-provider";
const services = [
{
diff --git a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/4-agent/page.tsx b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/4-agent/page.tsx
index e8115b63b3..2635c48867 100644
--- a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/4-agent/page.tsx
+++ b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/4-agent/page.tsx
@@ -1,18 +1,18 @@
"use client";
-import OnboardingButton from "@/components/onboarding/OnboardingButton";
+import OnboardingButton from "../components/OnboardingButton";
import {
OnboardingFooter,
OnboardingHeader,
OnboardingStep,
-} from "@/components/onboarding/OnboardingStep";
-import { OnboardingText } from "@/components/onboarding/OnboardingText";
-import OnboardingAgentCard from "@/components/onboarding/OnboardingAgentCard";
+} from "../components/OnboardingStep";
+import { OnboardingText } from "../components/OnboardingText";
+import OnboardingAgentCard from "../components/OnboardingAgentCard";
import { useEffect, useState } from "react";
import { useBackendAPI } from "@/lib/autogpt-server-api/context";
import { StoreAgentDetails } from "@/lib/autogpt-server-api";
import { finishOnboarding } from "../6-congrats/actions";
import { isEmptyOrWhitespace } from "@/lib/utils";
-import { useOnboarding } from "@/components/onboarding/onboarding-provider";
+import { useOnboarding } from "../../../../providers/onboarding/onboarding-provider";
export default function Page() {
const { state, updateState } = useOnboarding(4, "INTEGRATIONS");
diff --git a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/5-run/page.tsx b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/5-run/page.tsx
index e864f79043..7b76de3361 100644
--- a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/5-run/page.tsx
+++ b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/5-run/page.tsx
@@ -1,14 +1,10 @@
"use client";
import SmartImage from "@/components/agptui/SmartImage";
-import { useOnboarding } from "@/components/onboarding/onboarding-provider";
-import OnboardingButton from "@/components/onboarding/OnboardingButton";
-import {
- OnboardingHeader,
- OnboardingStep,
-} from "@/components/onboarding/OnboardingStep";
-import { OnboardingText } from "@/components/onboarding/OnboardingText";
-import StarRating from "@/components/onboarding/StarRating";
-import SchemaTooltip from "@/components/SchemaTooltip";
+import { useOnboarding } from "../../../../providers/onboarding/onboarding-provider";
+import OnboardingButton from "../components/OnboardingButton";
+import { OnboardingHeader, OnboardingStep } from "../components/OnboardingStep";
+import { OnboardingText } from "../components/OnboardingText";
+import StarRating from "../components/StarRating";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { useToast } from "@/components/molecules/Toast/use-toast";
import { GraphMeta, StoreAgentDetails } from "@/lib/autogpt-server-api";
@@ -18,6 +14,7 @@ import { Play } from "lucide-react";
import { useRouter } from "next/navigation";
import { useCallback, useEffect, useState } from "react";
import { RunAgentInputs } from "@/app/(platform)/library/agents/[id]/components/AgentRunsView/components/RunAgentInputs/RunAgentInputs";
+import { InformationTooltip } from "@/components/molecules/InformationTooltip/InformationTooltip";
export default function Page() {
const { state, updateState, setStep } = useOnboarding(
@@ -229,7 +226,7 @@ export default function Page() {
<div key={key} className="flex flex-col space-y-2">
<label className="flex items-center gap-1 text-sm font-medium">
{inputSubSchema.title || key}
- <SchemaTooltip
+ <InformationTooltip
description={inputSubSchema.description}
/>
</label>
diff --git a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/6-congrats/page.tsx b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/6-congrats/page.tsx
index 2dfdd3dbc0..0cac60c6f0 100644
--- a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/6-congrats/page.tsx
+++ b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/6-congrats/page.tsx
@@ -2,7 +2,7 @@
import { useEffect, useRef, useState } from "react";
import { cn } from "@/lib/utils";
import { finishOnboarding } from "./actions";
-import { useOnboarding } from "@/components/onboarding/onboarding-provider";
+import { useOnboarding } from "../../../../providers/onboarding/onboarding-provider";
import * as party from "party-js";
export default function Page() {
diff --git a/autogpt_platform/frontend/src/components/onboarding/OnboardingAgentCard.tsx b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/components/OnboardingAgentCard.tsx
similarity index 98%
rename from autogpt_platform/frontend/src/components/onboarding/OnboardingAgentCard.tsx
rename to autogpt_platform/frontend/src/app/(no-navbar)/onboarding/components/OnboardingAgentCard.tsx
index 45e484b595..610f9d1a8a 100644
--- a/autogpt_platform/frontend/src/components/onboarding/OnboardingAgentCard.tsx
+++ b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/components/OnboardingAgentCard.tsx
@@ -1,7 +1,7 @@
import { cn } from "@/lib/utils";
import StarRating from "./StarRating";
import { StoreAgentDetails } from "@/lib/autogpt-server-api";
-import SmartImage from "../agptui/SmartImage";
+import SmartImage from "@/components/agptui/SmartImage";
type OnboardingAgentCardProps = {
agent?: StoreAgentDetails;
diff --git a/autogpt_platform/frontend/src/components/onboarding/OnboardingBackButton.tsx b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/components/OnboardingBackButton.tsx
similarity index 100%
rename from autogpt_platform/frontend/src/components/onboarding/OnboardingBackButton.tsx
rename to autogpt_platform/frontend/src/app/(no-navbar)/onboarding/components/OnboardingBackButton.tsx
diff --git a/autogpt_platform/frontend/src/components/onboarding/OnboardingButton.tsx b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/components/OnboardingButton.tsx
similarity index 100%
rename from autogpt_platform/frontend/src/components/onboarding/OnboardingButton.tsx
rename to autogpt_platform/frontend/src/app/(no-navbar)/onboarding/components/OnboardingButton.tsx
diff --git a/autogpt_platform/frontend/src/components/onboarding/OnboardingGrid.tsx b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/components/OnboardingGrid.tsx
similarity index 97%
rename from autogpt_platform/frontend/src/components/onboarding/OnboardingGrid.tsx
rename to autogpt_platform/frontend/src/app/(no-navbar)/onboarding/components/OnboardingGrid.tsx
index 1ac56ca56c..ff088da6fd 100644
--- a/autogpt_platform/frontend/src/components/onboarding/OnboardingGrid.tsx
+++ b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/components/OnboardingGrid.tsx
@@ -1,5 +1,5 @@
import { cn } from "@/lib/utils";
-import SmartImage from "../agptui/SmartImage";
+import SmartImage from "@/components/agptui/SmartImage";
type OnboardingGridElementProps = {
name: string;
diff --git a/autogpt_platform/frontend/src/components/onboarding/OnboardingInput.tsx b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/components/OnboardingInput.tsx
similarity index 100%
rename from autogpt_platform/frontend/src/components/onboarding/OnboardingInput.tsx
rename to autogpt_platform/frontend/src/app/(no-navbar)/onboarding/components/OnboardingInput.tsx
diff --git a/autogpt_platform/frontend/src/components/onboarding/OnboardingList.tsx b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/components/OnboardingList.tsx
similarity index 100%
rename from autogpt_platform/frontend/src/components/onboarding/OnboardingList.tsx
rename to autogpt_platform/frontend/src/app/(no-navbar)/onboarding/components/OnboardingList.tsx
diff --git a/autogpt_platform/frontend/src/components/onboarding/OnboardingProgress.tsx b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/components/OnboardingProgress.tsx
similarity index 100%
rename from autogpt_platform/frontend/src/components/onboarding/OnboardingProgress.tsx
rename to autogpt_platform/frontend/src/app/(no-navbar)/onboarding/components/OnboardingProgress.tsx
diff --git a/autogpt_platform/frontend/src/components/onboarding/OnboardingStep.tsx b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/components/OnboardingStep.tsx
similarity index 95%
rename from autogpt_platform/frontend/src/components/onboarding/OnboardingStep.tsx
rename to autogpt_platform/frontend/src/app/(no-navbar)/onboarding/components/OnboardingStep.tsx
index 09a0c88377..23ceec2aee 100644
--- a/autogpt_platform/frontend/src/components/onboarding/OnboardingStep.tsx
+++ b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/components/OnboardingStep.tsx
@@ -3,7 +3,7 @@ import { ReactNode } from "react";
import OnboardingBackButton from "./OnboardingBackButton";
import { cn } from "@/lib/utils";
import OnboardingProgress from "./OnboardingProgress";
-import { useOnboarding } from "./onboarding-provider";
+import { useOnboarding } from "../../../../providers/onboarding/onboarding-provider";
export function OnboardingStep({
dotted,
diff --git a/autogpt_platform/frontend/src/components/onboarding/OnboardingText.tsx b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/components/OnboardingText.tsx
similarity index 100%
rename from autogpt_platform/frontend/src/components/onboarding/OnboardingText.tsx
rename to autogpt_platform/frontend/src/app/(no-navbar)/onboarding/components/OnboardingText.tsx
diff --git a/autogpt_platform/frontend/src/components/onboarding/StarRating.tsx b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/components/StarRating.tsx
similarity index 100%
rename from autogpt_platform/frontend/src/components/onboarding/StarRating.tsx
rename to autogpt_platform/frontend/src/app/(no-navbar)/onboarding/components/StarRating.tsx
diff --git a/autogpt_platform/frontend/src/components/onboarding/WalletTaskGroups.tsx b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/components/WalletTaskGroups.tsx
similarity index 99%
rename from autogpt_platform/frontend/src/components/onboarding/WalletTaskGroups.tsx
rename to autogpt_platform/frontend/src/app/(no-navbar)/onboarding/components/WalletTaskGroups.tsx
index f5c23b6881..bc8ed8e1f3 100644
--- a/autogpt_platform/frontend/src/components/onboarding/WalletTaskGroups.tsx
+++ b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/components/WalletTaskGroups.tsx
@@ -1,7 +1,7 @@
import { useCallback, useEffect, useRef, useState } from "react";
import { ChevronDown, Check } from "lucide-react";
import { OnboardingStep } from "@/lib/autogpt-server-api";
-import { useOnboarding } from "./onboarding-provider";
+import { useOnboarding } from "../../../../providers/onboarding/onboarding-provider";
import { cn } from "@/lib/utils";
import * as party from "party-js";
diff --git a/autogpt_platform/frontend/src/app/(platform)/build/components/NewBlockMenu/GraphMenu/GraphMenu.tsx b/autogpt_platform/frontend/src/app/(platform)/build/components/NewBlockMenu/GraphMenu/GraphMenu.tsx
index 43ade0b2d1..4675cbef69 100644
--- a/autogpt_platform/frontend/src/app/(platform)/build/components/NewBlockMenu/GraphMenu/GraphMenu.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/build/components/NewBlockMenu/GraphMenu/GraphMenu.tsx
@@ -7,7 +7,7 @@ import {
import { MagnifyingGlassIcon } from "@phosphor-icons/react";
import { GraphSearchContent } from "../GraphMenuContent/GraphContent";
import { ControlPanelButton } from "../ControlPanelButton";
-import { CustomNode } from "@/components/CustomNode";
+import { CustomNode } from "@/app/(platform)/build/components/legacy-builder/CustomNode/CustomNode";
import { useGraphMenu } from "./useGraphMenu";
interface GraphSearchMenuProps {
@@ -71,4 +71,4 @@ export const GraphSearchMenu: React.FC<GraphSearchMenuProps> = ({
</PopoverContent>
</Popover>
);
-};
\ No newline at end of file
+};
diff --git a/autogpt_platform/frontend/src/app/(platform)/build/components/NewBlockMenu/GraphMenu/useGraphMenu.ts b/autogpt_platform/frontend/src/app/(platform)/build/components/NewBlockMenu/GraphMenu/useGraphMenu.ts
index 1a6e8161be..ad903fe35f 100644
--- a/autogpt_platform/frontend/src/app/(platform)/build/components/NewBlockMenu/GraphMenu/useGraphMenu.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/build/components/NewBlockMenu/GraphMenu/useGraphMenu.ts
@@ -1,5 +1,5 @@
import { useGraphSearch } from "../GraphMenuSearchBar/useGraphMenuSearchBar";
-import { CustomNode } from "@/components/CustomNode";
+import { CustomNode } from "@/app/(platform)/build/components/legacy-builder/CustomNode/CustomNode";
interface UseGraphMenuProps {
nodes: CustomNode[];
@@ -15,7 +15,7 @@ export const useGraphMenu = ({
setBlockMenuSelected,
onNodeSelect,
}: UseGraphMenuProps) => {
- const { open, setOpen, searchQuery, setSearchQuery, filteredNodes } =
+ const { open, setOpen, searchQuery, setSearchQuery, filteredNodes } =
useGraphSearch(nodes);
const handleNodeSelect = (nodeId: string) => {
@@ -38,4 +38,4 @@ export const useGraphMenu = ({
handleNodeSelect,
handleOpenChange,
};
-};
\ No newline at end of file
+};
diff --git a/autogpt_platform/frontend/src/app/(platform)/build/components/NewBlockMenu/GraphMenuContent/GraphContent.tsx b/autogpt_platform/frontend/src/app/(platform)/build/components/NewBlockMenu/GraphMenuContent/GraphContent.tsx
index cf4d0ebfa8..898d3b7b30 100644
--- a/autogpt_platform/frontend/src/app/(platform)/build/components/NewBlockMenu/GraphMenuContent/GraphContent.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/build/components/NewBlockMenu/GraphMenuContent/GraphContent.tsx
@@ -9,7 +9,7 @@ import {
TooltipContent,
TooltipTrigger,
TooltipProvider,
-} from "@/components/ui/tooltip";
+} from "@/components/atoms/Tooltip/BaseTooltip";
import { GraphMenuSearchBar } from "../GraphMenuSearchBar/GraphMenuSearchBar";
import { useGraphContent } from "./useGraphContent";
@@ -42,25 +42,28 @@ export const GraphSearchContent: React.FC<GraphSearchContentProps> = ({
return (
<div className="flex h-full w-full flex-col">
{/* Search Bar */}
- <GraphMenuSearchBar
+ <GraphMenuSearchBar
searchQuery={searchQuery}
onSearchChange={onSearchChange}
onKeyDown={handleKeyDown}
/>
-
+
<Separator className="h-[1px] w-full text-zinc-300" />
-
+
{/* Search Results */}
<div className="flex-1 overflow-hidden">
{searchQuery && (
<div className="px-4 py-2 text-xs text-gray-500">
- Found {filteredNodes.length} node{filteredNodes.length !== 1 ? "s" : ""}
+ Found {filteredNodes.length} node
+ {filteredNodes.length !== 1 ? "s" : ""}
</div>
)}
<ScrollArea className="h-full w-full">
{filteredNodes.length === 0 ? (
<div className="flex h-32 items-center justify-center text-sm text-gray-500 dark:text-gray-400">
- {searchQuery ? "No nodes found matching your search" : "Start typing to search nodes"}
+ {searchQuery
+ ? "No nodes found matching your search"
+ : "Start typing to search nodes"}
</div>
) : (
filteredNodes.map((node, index) => {
@@ -68,19 +71,25 @@ export const GraphSearchContent: React.FC<GraphSearchContentProps> = ({
if (!node || !node.data) {
return null;
}
-
- const nodeTitle = node.data?.metadata?.customized_name ||
- beautifyString(node.data?.blockType || "").replace(/ Block$/, "");
- const nodeType = beautifyString(node.data?.blockType || "").replace(/ Block$/, "");
-
+
+ const nodeTitle =
+ node.data?.metadata?.customized_name ||
+ beautifyString(node.data?.blockType || "").replace(
+ / Block$/,
+ "",
+ );
+ const nodeType = beautifyString(
+ node.data?.blockType || "",
+ ).replace(/ Block$/, "");
+
return (
<TooltipProvider key={node.id}>
<Tooltip delayDuration={300}>
<TooltipTrigger asChild>
<div
className={`mx-4 my-2 flex h-20 cursor-pointer rounded-lg border border-zinc-200 bg-white ${
- index === selectedIndex
- ? "border-zinc-400 shadow-md"
+ index === selectedIndex
+ ? "border-zinc-400 shadow-md"
: "hover:border-zinc-300 hover:shadow-sm"
}`}
onClick={() => onNodeSelect(node.id)}
@@ -103,7 +112,11 @@ export const GraphSearchContent: React.FC<GraphSearchContentProps> = ({
</span>
<span className="block break-all text-xs font-normal text-zinc-500">
<TextRenderer
- value={getNodeInputOutputSummary(node) || node.data?.description || ""}
+ value={
+ getNodeInputOutputSummary(node) ||
+ node.data?.description ||
+ ""
+ }
truncateLengthLimit={165}
/>
</span>
@@ -113,9 +126,13 @@ export const GraphSearchContent: React.FC<GraphSearchContentProps> = ({
</TooltipTrigger>
<TooltipContent side="right" className="max-w-xs">
<div className="space-y-1">
- <div className="font-semibold">Node Type: {nodeType}</div>
+ <div className="font-semibold">
+ Node Type: {nodeType}
+ </div>
{node.data?.metadata?.customized_name && (
- <div className="text-xs text-gray-500">Custom Name: {node.data.metadata.customized_name}</div>
+ <div className="text-xs text-gray-500">
+ Custom Name: {node.data.metadata.customized_name}
+ </div>
)}
</div>
</TooltipContent>
@@ -128,4 +145,4 @@ export const GraphSearchContent: React.FC<GraphSearchContentProps> = ({
</div>
</div>
);
-};
\ No newline at end of file
+};
diff --git a/autogpt_platform/frontend/src/app/(platform)/build/components/NewBlockMenu/GraphMenuSearchBar/useGraphMenuSearchBar.tsx b/autogpt_platform/frontend/src/app/(platform)/build/components/NewBlockMenu/GraphMenuSearchBar/useGraphMenuSearchBar.tsx
index 65bf5c3e87..4342f4ee61 100644
--- a/autogpt_platform/frontend/src/app/(platform)/build/components/NewBlockMenu/GraphMenuSearchBar/useGraphMenuSearchBar.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/build/components/NewBlockMenu/GraphMenuSearchBar/useGraphMenuSearchBar.tsx
@@ -1,5 +1,5 @@
import { useState, useMemo, useDeferredValue } from "react";
-import { CustomNode } from "@/components/CustomNode";
+import { CustomNode } from "@/app/(platform)/build/components/legacy-builder/CustomNode/CustomNode";
import { beautifyString } from "@/lib/utils";
import jaro from "jaro-winkler";
@@ -15,10 +15,14 @@ export const useGraphSearch = (nodes: CustomNode[]) => {
const filteredNodes = useMemo(() => {
// Filter out invalid nodes
- const validNodes = (nodes || []).filter(node => node && node.data);
-
+ const validNodes = (nodes || []).filter((node) => node && node.data);
+
if (!deferredSearchQuery.trim()) {
- return validNodes.map(node => ({ ...node, searchScore: 1, matchedFields: [] }));
+ return validNodes.map((node) => ({
+ ...node,
+ searchScore: 1,
+ matchedFields: [],
+ }));
}
const query = deferredSearchQuery.toLowerCase().trim();
@@ -26,10 +30,14 @@ export const useGraphSearch = (nodes: CustomNode[]) => {
return validNodes
.map((node): SearchableNode => {
- const { score, matchedFields } = calculateNodeScore(node, query, queryWords);
+ const { score, matchedFields } = calculateNodeScore(
+ node,
+ query,
+ queryWords,
+ );
return { ...node, searchScore: score, matchedFields };
})
- .filter(node => node.searchScore! > 0)
+ .filter((node) => node.searchScore! > 0)
.sort((a, b) => b.searchScore! - a.searchScore!);
}, [nodes, deferredSearchQuery]);
@@ -43,9 +51,9 @@ export const useGraphSearch = (nodes: CustomNode[]) => {
};
function calculateNodeScore(
- node: CustomNode,
- query: string,
- queryWords: string[]
+ node: CustomNode,
+ query: string,
+ queryWords: string[],
): { score: number; matchedFields: string[] } {
const matchedFields: string[] = [];
let score = 0;
@@ -61,64 +69,89 @@ function calculateNodeScore(
const nodeDescription = (node.data?.description || "").toLowerCase();
const blockType = (node.data?.blockType || "").toLowerCase();
const beautifiedBlockType = beautifyString(blockType).toLowerCase();
- const customizedName = (node.data?.metadata?.customized_name || "").toLowerCase();
-
+ const customizedName = (
+ node.data?.metadata?.customized_name || ""
+ ).toLowerCase();
+
// Get input and output names with defensive checks
- const inputNames = Object.keys(node.data?.inputSchema?.properties || {})
- .map(key => key.toLowerCase());
- const outputNames = Object.keys(node.data?.outputSchema?.properties || {})
- .map(key => key.toLowerCase());
-
+ const inputNames = Object.keys(node.data?.inputSchema?.properties || {}).map(
+ (key) => key.toLowerCase(),
+ );
+ const outputNames = Object.keys(
+ node.data?.outputSchema?.properties || {},
+ ).map((key) => key.toLowerCase());
+
// 1. Check exact match in customized name, title (includes ID), node ID, or block type (highest priority)
- if (customizedName.includes(query) || nodeTitle.includes(query) || nodeId.includes(query) || blockType.includes(query) || beautifiedBlockType.includes(query)) {
+ if (
+ customizedName.includes(query) ||
+ nodeTitle.includes(query) ||
+ nodeId.includes(query) ||
+ blockType.includes(query) ||
+ beautifiedBlockType.includes(query)
+ ) {
score = 4;
matchedFields.push("title");
}
-
+
// 2. Check all query words in customized name, title or block type
- else if (queryWords.every(word => customizedName.includes(word) || nodeTitle.includes(word) || beautifiedBlockType.includes(word))) {
+ else if (
+ queryWords.every(
+ (word) =>
+ customizedName.includes(word) ||
+ nodeTitle.includes(word) ||
+ beautifiedBlockType.includes(word),
+ )
+ ) {
score = 3.5;
matchedFields.push("title");
}
-
+
// 3. Check exact match in input/output names
- else if (inputNames.some(name => name.includes(query))) {
+ else if (inputNames.some((name) => name.includes(query))) {
score = 3;
matchedFields.push("inputs");
- }
- else if (outputNames.some(name => name.includes(query))) {
+ } else if (outputNames.some((name) => name.includes(query))) {
score = 2.8;
matchedFields.push("outputs");
}
-
+
// 4. Check all query words in input/output names
- else if (inputNames.some(name => queryWords.every(word => name.includes(word)))) {
+ else if (
+ inputNames.some((name) => queryWords.every((word) => name.includes(word)))
+ ) {
score = 2.5;
matchedFields.push("inputs");
- }
- else if (outputNames.some(name => queryWords.every(word => name.includes(word)))) {
+ } else if (
+ outputNames.some((name) => queryWords.every((word) => name.includes(word)))
+ ) {
score = 2.3;
matchedFields.push("outputs");
}
-
+
// 5. Similarity matching using Jaro-Winkler
else {
const titleSimilarity = Math.max(
jaro(customizedName, query),
jaro(nodeTitle, query),
jaro(nodeId, query),
- jaro(beautifiedBlockType, query)
+ jaro(beautifiedBlockType, query),
);
-
+
if (titleSimilarity > 0.7) {
score = 1.5 + titleSimilarity;
matchedFields.push("title");
}
-
+
// Check similarity with input/output names
- const inputSimilarity = Math.max(...inputNames.map(name => jaro(name, query)), 0);
- const outputSimilarity = Math.max(...outputNames.map(name => jaro(name, query)), 0);
-
+ const inputSimilarity = Math.max(
+ ...inputNames.map((name) => jaro(name, query)),
+ 0,
+ );
+ const outputSimilarity = Math.max(
+ ...outputNames.map((name) => jaro(name, query)),
+ 0,
+ );
+
if (inputSimilarity > 0.7 && inputSimilarity > score) {
score = 1 + inputSimilarity;
matchedFields.push("inputs");
@@ -128,19 +161,21 @@ function calculateNodeScore(
matchedFields.push("outputs");
}
}
-
+
// 6. Check description (lower priority)
if (score === 0 && nodeDescription.includes(query)) {
score = 0.5;
matchedFields.push("description");
}
-
+
// 7. Check if all query words appear in description
- if (score === 0 && queryWords.every(word => nodeDescription.includes(word))) {
+ if (
+ score === 0 &&
+ queryWords.every((word) => nodeDescription.includes(word))
+ ) {
score = 0.3;
matchedFields.push("description");
}
return { score, matchedFields };
}
-
diff --git a/autogpt_platform/frontend/src/app/(platform)/build/components/NewBlockMenu/NewControlPanel/NewControlPanel.tsx b/autogpt_platform/frontend/src/app/(platform)/build/components/NewBlockMenu/NewControlPanel/NewControlPanel.tsx
index 15694aa38f..0541fd5b0d 100644
--- a/autogpt_platform/frontend/src/app/(platform)/build/components/NewBlockMenu/NewControlPanel/NewControlPanel.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/build/components/NewBlockMenu/NewControlPanel/NewControlPanel.tsx
@@ -5,11 +5,11 @@ import { BlockMenu } from "../BlockMenu/BlockMenu";
import { useNewControlPanel } from "./useNewControlPanel";
import { NewSaveControl } from "../SaveControl/NewSaveControl";
import { GraphExecutionID } from "@/lib/autogpt-server-api";
-import { history } from "@/components/history";
+import { history } from "@/app/(platform)/build/components/legacy-builder/history";
import { ControlPanelButton } from "../ControlPanelButton";
import { ArrowUUpLeftIcon, ArrowUUpRightIcon } from "@phosphor-icons/react";
import { GraphSearchMenu } from "../GraphMenu/GraphMenu";
-import { CustomNode } from "@/components/CustomNode";
+import { CustomNode } from "@/app/(platform)/build/components/legacy-builder/CustomNode/CustomNode";
import { Flag, useGetFlag } from "@/services/feature-flags/use-get-flag";
export type Control = {
diff --git a/autogpt_platform/frontend/src/components/edit/control/BlocksControl.tsx b/autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/BlocksControl.tsx
similarity index 98%
rename from autogpt_platform/frontend/src/components/edit/control/BlocksControl.tsx
rename to autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/BlocksControl.tsx
index e31b7d1291..0a8360f437 100644
--- a/autogpt_platform/frontend/src/components/edit/control/BlocksControl.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/BlocksControl.tsx
@@ -5,7 +5,7 @@ import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { TextRenderer } from "@/components/ui/render";
import { ScrollArea } from "@/components/ui/scroll-area";
-import { CustomNode } from "@/components/CustomNode";
+import { CustomNode } from "@/app/(platform)/build/components/legacy-builder/CustomNode/CustomNode";
import { beautifyString } from "@/lib/utils";
import {
Popover,
@@ -20,7 +20,7 @@ import {
Tooltip,
TooltipContent,
TooltipTrigger,
-} from "@/components/ui/tooltip";
+} from "@/components/atoms/Tooltip/BaseTooltip";
import { GraphMeta } from "@/lib/autogpt-server-api";
import jaro from "jaro-winkler";
diff --git a/autogpt_platform/frontend/src/components/PrimaryActionButton.tsx b/autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/BuildActionBar.tsx
similarity index 95%
rename from autogpt_platform/frontend/src/components/PrimaryActionButton.tsx
rename to autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/BuildActionBar.tsx
index 1d2134321b..09100ce2d7 100644
--- a/autogpt_platform/frontend/src/components/PrimaryActionButton.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/BuildActionBar.tsx
@@ -5,7 +5,7 @@ import { LogOut } from "lucide-react";
import { ClockIcon } from "@phosphor-icons/react";
import { IconPlay, IconSquare } from "@/components/ui/icons";
-interface PrimaryActionBarProps {
+interface Props {
onClickAgentOutputs?: () => void;
onClickRunAgent?: () => void;
onClickStopRun: () => void;
@@ -15,7 +15,7 @@ interface PrimaryActionBarProps {
className?: string;
}
-const PrimaryActionBar: React.FC<PrimaryActionBarProps> = ({
+export const BuildActionBar: React.FC<Props> = ({
onClickAgentOutputs,
onClickRunAgent,
onClickStopRun,
@@ -94,5 +94,3 @@ const PrimaryActionBar: React.FC<PrimaryActionBarProps> = ({
</div>
);
};
-
-export default PrimaryActionBar;
diff --git a/autogpt_platform/frontend/src/components/ConnectionLine.tsx b/autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/ConnectionLine.tsx
similarity index 100%
rename from autogpt_platform/frontend/src/components/ConnectionLine.tsx
rename to autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/ConnectionLine.tsx
diff --git a/autogpt_platform/frontend/src/components/edit/control/ControlPanel.tsx b/autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/ControlPanel.tsx
similarity index 98%
rename from autogpt_platform/frontend/src/components/edit/control/ControlPanel.tsx
rename to autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/ControlPanel.tsx
index 870d345822..2c48f76d5b 100644
--- a/autogpt_platform/frontend/src/components/edit/control/ControlPanel.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/ControlPanel.tsx
@@ -3,7 +3,7 @@ import {
Tooltip,
TooltipContent,
TooltipTrigger,
-} from "@/components/ui/tooltip";
+} from "@/components/atoms/Tooltip/BaseTooltip";
import { Button } from "@/components/ui/button";
import { Separator } from "@/components/ui/separator";
import { cn } from "@/lib/utils";
diff --git a/autogpt_platform/frontend/src/components/CustomEdge.tsx b/autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/CustomEdge/CustomEdge.tsx
similarity index 98%
rename from autogpt_platform/frontend/src/components/CustomEdge.tsx
rename to autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/CustomEdge/CustomEdge.tsx
index 509c540224..84f32fe8c7 100644
--- a/autogpt_platform/frontend/src/components/CustomEdge.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/CustomEdge/CustomEdge.tsx
@@ -16,9 +16,9 @@ import {
} from "@xyflow/react";
import "./customedge.css";
import { X } from "lucide-react";
-import { useBezierPath } from "@/hooks/useBezierPath";
-import { BuilderContext } from "./Flow";
+import { BuilderContext } from "../Flow/Flow";
import { NodeExecutionResult } from "@/lib/autogpt-server-api";
+import { useCustomEdge } from "./useCustomEdge";
export type CustomEdgeData = {
edgeColor: string;
@@ -53,7 +53,7 @@ export function CustomEdge({
destroyed: number;
}>({ beads: [], created: 0, destroyed: 0 });
const beadsRef = useRef(beads);
- const { svgPath, length, getPointForT, getTForDistance } = useBezierPath(
+ const { svgPath, length, getPointForT, getTForDistance } = useCustomEdge(
sourceX - 5,
sourceY - 5,
targetX + 3,
diff --git a/autogpt_platform/frontend/src/components/customedge.css b/autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/CustomEdge/customedge.css
similarity index 100%
rename from autogpt_platform/frontend/src/components/customedge.css
rename to autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/CustomEdge/customedge.css
diff --git a/autogpt_platform/frontend/src/hooks/useBezierPath.ts b/autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/CustomEdge/useCustomEdge.ts
similarity index 99%
rename from autogpt_platform/frontend/src/hooks/useBezierPath.ts
rename to autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/CustomEdge/useCustomEdge.ts
index 0c67fe4046..f8fdeda411 100644
--- a/autogpt_platform/frontend/src/hooks/useBezierPath.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/CustomEdge/useCustomEdge.ts
@@ -12,7 +12,7 @@ export type BezierPath = {
targetPosition: XYPosition;
};
-export function useBezierPath(
+export function useCustomEdge(
sourceX: number,
sourceY: number,
targetX: number,
diff --git a/autogpt_platform/frontend/src/components/CustomNode.tsx b/autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/CustomNode/CustomNode.tsx
similarity index 95%
rename from autogpt_platform/frontend/src/components/CustomNode.tsx
rename to autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/CustomNode/CustomNode.tsx
index f85d3071e7..dcc3cf5b26 100644
--- a/autogpt_platform/frontend/src/components/CustomNode.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/CustomNode/CustomNode.tsx
@@ -9,8 +9,8 @@ import Link from "next/link";
import { NodeProps, useReactFlow, Node as XYNode, Edge } from "@xyflow/react";
import "@xyflow/react/dist/style.css";
import "./customnode.css";
-import InputModalComponent from "./InputModalComponent";
-import OutputModalComponent from "./OutputModalComponent";
+import InputModalComponent from "../InputModalComponent";
+import OutputModalComponent from "../OutputModalComponent";
import {
BlockIORootSchema,
BlockIOSubSchema,
@@ -31,21 +31,17 @@ import {
} from "@/lib/utils";
import { Button } from "@/components/atoms/Button/Button";
import { TextRenderer } from "@/components/ui/render";
-import { history } from "./history";
-import NodeHandle from "./NodeHandle";
-import {
- NodeGenericInputField,
- NodeTextBoxInput,
-} from "./node-input-components";
+import { history } from "../history";
+import NodeHandle from "../NodeHandle";
+import { NodeGenericInputField, NodeTextBoxInput } from "../NodeInputs";
import { getPrimaryCategoryColor } from "@/lib/utils";
-import { BuilderContext } from "./Flow";
-import { Badge } from "./ui/badge";
-import NodeOutputs from "./NodeOutputs";
-import SchemaTooltip from "./SchemaTooltip";
-import { IconCoin } from "./ui/icons";
+import { BuilderContext } from "../Flow/Flow";
+import { Badge } from "../../../../../../components/ui/badge";
+import NodeOutputs from "../NodeOutputs";
+import { IconCoin } from "../../../../../../components/ui/icons";
import * as Separator from "@radix-ui/react-separator";
import * as ContextMenu from "@radix-ui/react-context-menu";
-import { Alert, AlertDescription } from "./ui/alert";
+import { Alert, AlertDescription } from "../../../../../../components/ui/alert";
import {
DotsVerticalIcon,
TrashIcon,
@@ -58,13 +54,13 @@ import useCredits from "@/hooks/useCredits";
import { getV1GetAyrshareSsoUrl } from "@/app/api/__generated__/endpoints/integrations/integrations";
import { toast } from "@/components/molecules/Toast/use-toast";
import { Input } from "@/components/ui/input";
-import { Switch } from "./atoms/Switch/Switch";
import {
Tooltip,
TooltipContent,
- TooltipProvider,
TooltipTrigger,
-} from "@/components/ui/tooltip";
+} from "@/components/atoms/Tooltip/BaseTooltip";
+import { InformationTooltip } from "@/components/molecules/InformationTooltip/InformationTooltip";
+import { Switch } from "@/components/atoms/Switch/Switch";
export type ConnectionData = Array<{
edge_id: string;
@@ -424,7 +420,9 @@ export const CustomNode = React.memo(
<span className="text-m green mb-0 text-gray-900 dark:text-gray-100">
{propSchema.title || beautifyString(propKey)}
</span>
- <SchemaTooltip description={propSchema.description} />
+ <InformationTooltip
+ description={propSchema.description}
+ />
</div>
)
)}
@@ -825,29 +823,26 @@ export const CustomNode = React.memo(
)}
/>
) : (
- <TooltipProvider>
- <Tooltip>
- <TooltipTrigger asChild>
- <h3 className="font-roboto cursor-default text-lg">
- <TextRenderer
- value={displayTitle}
- truncateLengthLimit={80}
- />
- </h3>
- </TooltipTrigger>
- {customTitle && (
- <TooltipContent>
- <p>
- Type:{" "}
- {beautifyString(
- data.blockType?.replace(/Block$/, "") ||
- data.title,
- )}
- </p>
- </TooltipContent>
- )}
- </Tooltip>
- </TooltipProvider>
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <h3 className="font-roboto cursor-default text-lg">
+ <TextRenderer
+ value={displayTitle}
+ truncateLengthLimit={80}
+ />
+ </h3>
+ </TooltipTrigger>
+ {customTitle && (
+ <TooltipContent>
+ <p>
+ Type:{" "}
+ {beautifyString(
+ data.blockType?.replace(/Block$/, "") || data.title,
+ )}
+ </p>
+ </TooltipContent>
+ )}
+ </Tooltip>
)}
{isTitleHovered && !isEditingTitle && (
<button
diff --git a/autogpt_platform/frontend/src/components/customnode.css b/autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/CustomNode/customnode.css
similarity index 100%
rename from autogpt_platform/frontend/src/components/customnode.css
rename to autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/CustomNode/customnode.css
diff --git a/autogpt_platform/frontend/src/components/DataTable.tsx b/autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/DataTable.tsx
similarity index 93%
rename from autogpt_platform/frontend/src/components/DataTable.tsx
rename to autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/DataTable.tsx
index e33a0bac1e..1eca2b4c54 100644
--- a/autogpt_platform/frontend/src/components/DataTable.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/DataTable.tsx
@@ -1,8 +1,8 @@
import { beautifyString } from "@/lib/utils";
import { Clipboard, Maximize2 } from "lucide-react";
import React, { useState } from "react";
-import { Button } from "./ui/button";
-import { ContentRenderer } from "./ui/render";
+import { Button } from "../../../../../components/ui/button";
+import { ContentRenderer } from "../../../../../components/ui/render";
import {
Table,
TableBody,
@@ -10,8 +10,8 @@ import {
TableHead,
TableHeader,
TableRow,
-} from "./ui/table";
-import { useToast } from "./molecules/Toast/use-toast";
+} from "../../../../../components/ui/table";
+import { useToast } from "../../../../../components/molecules/Toast/use-toast";
import ExpandableOutputDialog from "./ExpandableOutputDialog";
type DataTableProps = {
diff --git a/autogpt_platform/frontend/src/components/ExpandableOutputDialog.tsx b/autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/ExpandableOutputDialog.tsx
similarity index 94%
rename from autogpt_platform/frontend/src/components/ExpandableOutputDialog.tsx
rename to autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/ExpandableOutputDialog.tsx
index c5b21eaa56..ef209f09a6 100644
--- a/autogpt_platform/frontend/src/components/ExpandableOutputDialog.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/ExpandableOutputDialog.tsx
@@ -1,10 +1,10 @@
import React, { FC, useMemo, useState } from "react";
-import { Button } from "./ui/button";
-import { ContentRenderer } from "./ui/render";
+import { Button } from "../../../../../components/ui/button";
+import { ContentRenderer } from "../../../../../components/ui/render";
import { beautifyString } from "@/lib/utils";
import { Clipboard, Maximize2 } from "lucide-react";
-import { useToast } from "./molecules/Toast/use-toast";
-import { Switch } from "./atoms/Switch/Switch";
+import { useToast } from "../../../../../components/molecules/Toast/use-toast";
+import { Switch } from "../../../../../components/atoms/Switch/Switch";
import {
Dialog,
DialogContent,
@@ -12,9 +12,9 @@ import {
DialogTitle,
DialogDescription,
DialogFooter,
-} from "./ui/dialog";
-import { ScrollArea } from "./ui/scroll-area";
-import { Separator } from "./ui/separator";
+} from "../../../../../components/ui/dialog";
+import { ScrollArea } from "../../../../../components/ui/scroll-area";
+import { Separator } from "../../../../../components/ui/separator";
import { Flag, useGetFlag } from "@/services/feature-flags/use-get-flag";
import {
globalRegistry,
diff --git a/autogpt_platform/frontend/src/components/Flow.tsx b/autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/Flow/Flow.tsx
similarity index 96%
rename from autogpt_platform/frontend/src/components/Flow.tsx
rename to autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/Flow/Flow.tsx
index ab29d730db..32dc3cb578 100644
--- a/autogpt_platform/frontend/src/components/Flow.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/Flow/Flow.tsx
@@ -26,7 +26,7 @@ import {
applyNodeChanges,
} from "@xyflow/react";
import "@xyflow/react/dist/style.css";
-import { CustomNode } from "./CustomNode";
+import { CustomNode } from "../CustomNode/CustomNode";
import "./flow.css";
import {
BlockUIType,
@@ -41,28 +41,29 @@ import {
findNewlyAddedBlockCoordinates,
beautifyString,
} from "@/lib/utils";
-import { history } from "./history";
-import { CustomEdge } from "./CustomEdge";
-import ConnectionLine from "./ConnectionLine";
-import { Control, ControlPanel } from "@/components/edit/control/ControlPanel";
-import { SaveControl } from "@/components/edit/control/SaveControl";
-import { BlocksControl } from "@/components/edit/control/BlocksControl";
-import { GraphSearchControl } from "@/components/edit/control/GraphSearchControl";
+import { history } from "../history";
+import { CustomEdge } from "../CustomEdge/CustomEdge";
+import ConnectionLine from "../ConnectionLine";
+import {
+ Control,
+ ControlPanel,
+} from "@/app/(platform)/build/components/legacy-builder/ControlPanel";
+import { SaveControl } from "@/app/(platform)/build/components/legacy-builder/SaveControl";
+import { BlocksControl } from "@/app/(platform)/build/components/legacy-builder/BlocksControl";
+import { GraphSearchControl } from "@/app/(platform)/build/components/legacy-builder/GraphSearchControl";
import { IconUndo2, IconRedo2 } from "@/components/ui/icons";
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
-import { startTutorial } from "./tutorial";
+import { startTutorial } from "../tutorial";
import useAgentGraph from "@/hooks/useAgentGraph";
import { v4 as uuidv4 } from "uuid";
import { useRouter, usePathname, useSearchParams } from "next/navigation";
-import RunnerUIWrapper, {
- RunnerUIWrapperRef,
-} from "@/components/RunnerUIWrapper";
-import PrimaryActionBar from "@/components/PrimaryActionButton";
-import OttoChatWidget from "@/components/OttoChatWidget";
+import RunnerUIWrapper, { RunnerUIWrapperRef } from "../RunnerUIWrapper";
+import OttoChatWidget from "@/app/(platform)/build/components/legacy-builder/OttoChatWidget";
import { useToast } from "@/components/molecules/Toast/use-toast";
-import { useCopyPaste } from "../hooks/useCopyPaste";
+import { useCopyPaste } from "../../../../../../hooks/useCopyPaste";
import NewControlPanel from "@/app/(platform)/build/components/NewBlockMenu/NewControlPanel/NewControlPanel";
import { Flag, useGetFlag } from "@/services/feature-flags/use-get-flag";
+import { BuildActionBar } from "../BuildActionBar";
// This is for the history, this is the minimum distance a block must move before it is logged
// It helps to prevent spamming the history with small movements especially when pressing on a input in a block
@@ -899,7 +900,7 @@ const FlowEditor: React.FC<{
)}
{!graphHasWebhookNodes ? (
- <PrimaryActionBar
+ <BuildActionBar
className="absolute bottom-0 left-1/2 z-20 -translate-x-1/2"
onClickAgentOutputs={runnerUIRef.current?.openRunnerOutput}
onClickRunAgent={handleRunButton}
diff --git a/autogpt_platform/frontend/src/components/flow.css b/autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/Flow/flow.css
similarity index 100%
rename from autogpt_platform/frontend/src/components/flow.css
rename to autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/Flow/flow.css
diff --git a/autogpt_platform/frontend/src/components/edit/control/GraphSearchControl.tsx b/autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/GraphSearchControl.tsx
similarity index 87%
rename from autogpt_platform/frontend/src/components/edit/control/GraphSearchControl.tsx
rename to autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/GraphSearchControl.tsx
index 77e7519f09..6f2904475f 100644
--- a/autogpt_platform/frontend/src/components/edit/control/GraphSearchControl.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/GraphSearchControl.tsx
@@ -6,14 +6,14 @@ import {
} from "@/components/ui/popover";
import { Button } from "@/components/atoms/Button/Button";
import { MagnifyingGlassIcon } from "@radix-ui/react-icons";
-import { CustomNode } from "@/components/CustomNode";
-import { GraphSearchContent } from "../../../app/(platform)/build/components/NewBlockMenu/GraphMenuContent/GraphContent";
+import { CustomNode } from "@/app/(platform)/build/components/legacy-builder/CustomNode/CustomNode";
+import { GraphSearchContent } from "../NewBlockMenu/GraphMenuContent/GraphContent";
import {
Tooltip,
TooltipContent,
TooltipTrigger,
-} from "@/components/ui/tooltip";
-import { useGraphMenu } from "../../../app/(platform)/build/components/NewBlockMenu/GraphMenu/useGraphMenu";
+} from "@/components/atoms/Tooltip/BaseTooltip";
+import { useGraphMenu } from "../NewBlockMenu/GraphMenu/useGraphMenu";
interface GraphSearchControlProps {
nodes: CustomNode[];
diff --git a/autogpt_platform/frontend/src/components/InputModalComponent.tsx b/autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/InputModalComponent.tsx
similarity index 92%
rename from autogpt_platform/frontend/src/components/InputModalComponent.tsx
rename to autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/InputModalComponent.tsx
index a5e876e785..79c673dad5 100644
--- a/autogpt_platform/frontend/src/components/InputModalComponent.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/InputModalComponent.tsx
@@ -1,9 +1,9 @@
import React, { FC, useEffect, useState } from "react";
-import { Button } from "./ui/button";
-import { Textarea } from "./ui/textarea";
+import { Button } from "../../../../../components/ui/button";
+import { Textarea } from "../../../../../components/ui/textarea";
import { Maximize2, Minimize2, Clipboard } from "lucide-react";
import { createPortal } from "react-dom";
-import { toast } from "./molecules/Toast/use-toast";
+import { toast } from "../../../../../components/molecules/Toast/use-toast";
interface ModalProps {
isOpen: boolean;
diff --git a/autogpt_platform/frontend/src/components/NodeHandle.tsx b/autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/NodeHandle.tsx
similarity index 95%
rename from autogpt_platform/frontend/src/components/NodeHandle.tsx
rename to autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/NodeHandle.tsx
index 1cdf5af265..c3daeb8d47 100644
--- a/autogpt_platform/frontend/src/components/NodeHandle.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/NodeHandle.tsx
@@ -3,7 +3,7 @@ import { cn } from "@/lib/utils";
import { beautifyString, getTypeBgColor, getTypeTextColor } from "@/lib/utils";
import { FC, memo, useCallback } from "react";
import { Handle, Position } from "@xyflow/react";
-import SchemaTooltip from "./SchemaTooltip";
+import { InformationTooltip } from "@/components/molecules/InformationTooltip/InformationTooltip";
type HandleProps = {
keyName: string;
@@ -99,7 +99,7 @@ const NodeHandle: FC<HandleProps> = ({
{label}
</div>
</Handle>
- <SchemaTooltip description={schema.description} />
+ <InformationTooltip description={schema.description} />
</div>
);
} else {
diff --git a/autogpt_platform/frontend/src/components/node-input-components.tsx b/autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/NodeInputs.tsx
similarity index 98%
rename from autogpt_platform/frontend/src/components/node-input-components.tsx
rename to autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/NodeInputs.tsx
index 497365f8cb..afadabf641 100644
--- a/autogpt_platform/frontend/src/components/node-input-components.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/NodeInputs.tsx
@@ -8,7 +8,10 @@ import { format } from "date-fns";
import { CalendarIcon } from "lucide-react";
import { beautifyString, cn } from "@/lib/utils";
import { Node, useNodeId, useNodesData } from "@xyflow/react";
-import { ConnectionData, CustomNodeData } from "@/components/CustomNode";
+import {
+ ConnectionData,
+ CustomNodeData,
+} from "@/app/(platform)/build/components/legacy-builder/CustomNode/CustomNode";
import { Cross2Icon, Pencil2Icon, PlusIcon } from "@radix-ui/react-icons";
import {
BlockIOArraySubSchema,
@@ -33,14 +36,14 @@ import React, {
useState,
useRef,
} from "react";
-import { Button } from "./ui/button";
+import { Button } from "../../../../../components/ui/button";
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
-} from "./ui/select";
+} from "../../../../../components/ui/select";
import {
MultiSelector,
MultiSelectorContent,
@@ -48,11 +51,11 @@ import {
MultiSelectorItem,
MultiSelectorList,
MultiSelectorTrigger,
-} from "./ui/multiselect";
-import { LocalValuedInput } from "./ui/input";
+} from "../../../../../components/ui/multiselect";
+import { LocalValuedInput } from "../../../../../components/ui/input";
import NodeHandle from "./NodeHandle";
import { CredentialsInput } from "@/app/(platform)/library/agents/[id]/components/AgentRunsView/components/CredentialsInputs/CredentialsInputs";
-import { Switch } from "./atoms/Switch/Switch";
+import { Switch } from "../../../../../components/atoms/Switch/Switch";
type NodeObjectInputTreeProps = {
nodeId: string;
diff --git a/autogpt_platform/frontend/src/components/NodeOutputs.tsx b/autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/NodeOutputs.tsx
similarity index 95%
rename from autogpt_platform/frontend/src/components/NodeOutputs.tsx
rename to autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/NodeOutputs.tsx
index 6f4a4de0d5..5c57990ba7 100644
--- a/autogpt_platform/frontend/src/components/NodeOutputs.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/NodeOutputs.tsx
@@ -1,8 +1,8 @@
import React, { useState } from "react";
-import { ContentRenderer } from "./ui/render";
+import { ContentRenderer } from "../../../../../components/ui/render";
import { beautifyString } from "@/lib/utils";
import { Maximize2 } from "lucide-react";
-import { Button } from "./ui/button";
+import { Button } from "../../../../../components/ui/button";
import * as Separator from "@radix-ui/react-separator";
import ExpandableOutputDialog from "./ExpandableOutputDialog";
diff --git a/autogpt_platform/frontend/src/components/OttoChatWidget.tsx b/autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/OttoChatWidget.tsx
similarity index 100%
rename from autogpt_platform/frontend/src/components/OttoChatWidget.tsx
rename to autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/OttoChatWidget.tsx
diff --git a/autogpt_platform/frontend/src/components/OutputModalComponent.tsx b/autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/OutputModalComponent.tsx
similarity index 95%
rename from autogpt_platform/frontend/src/components/OutputModalComponent.tsx
rename to autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/OutputModalComponent.tsx
index 8cd7efa451..6311115262 100644
--- a/autogpt_platform/frontend/src/components/OutputModalComponent.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/OutputModalComponent.tsx
@@ -1,5 +1,5 @@
import React, { FC } from "react";
-import { Button } from "./ui/button";
+import { Button } from "../../../../../components/ui/button";
import { NodeExecutionResult } from "@/lib/autogpt-server-api/types";
import DataTable from "./DataTable";
import { Separator } from "@/components/ui/separator";
diff --git a/autogpt_platform/frontend/src/components/runner-ui/RunnerInputUI.tsx b/autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerInputUI.tsx
similarity index 100%
rename from autogpt_platform/frontend/src/components/runner-ui/RunnerInputUI.tsx
rename to autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerInputUI.tsx
diff --git a/autogpt_platform/frontend/src/components/runner-ui/RunnerOutputUI.tsx b/autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerOutputUI.tsx
similarity index 100%
rename from autogpt_platform/frontend/src/components/runner-ui/RunnerOutputUI.tsx
rename to autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerOutputUI.tsx
diff --git a/autogpt_platform/frontend/src/components/RunnerUIWrapper.tsx b/autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerUIWrapper.tsx
similarity index 93%
rename from autogpt_platform/frontend/src/components/RunnerUIWrapper.tsx
rename to autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerUIWrapper.tsx
index 9370c1c211..a9af065a5d 100644
--- a/autogpt_platform/frontend/src/components/RunnerUIWrapper.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerUIWrapper.tsx
@@ -5,16 +5,14 @@ import React, {
useMemo,
} from "react";
import { Node } from "@xyflow/react";
-import { CustomNodeData } from "@/components/CustomNode";
-import { RunnerInputDialog } from "@/components/runner-ui/RunnerInputUI";
+import { CustomNodeData } from "@/app/(platform)/build/components/legacy-builder/CustomNode/CustomNode";
import {
BlockUIType,
CredentialsMetaInput,
GraphMeta,
} from "@/lib/autogpt-server-api/types";
-import RunnerOutputUI, {
- OutputNodeInfo,
-} from "@/components/runner-ui/RunnerOutputUI";
+import RunnerOutputUI, { OutputNodeInfo } from "./RunnerOutputUI";
+import { RunnerInputDialog } from "./RunnerInputUI";
interface RunnerUIWrapperProps {
graph: GraphMeta;
diff --git a/autogpt_platform/frontend/src/components/edit/control/SaveControl.tsx b/autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/SaveControl.tsx
similarity index 97%
rename from autogpt_platform/frontend/src/components/edit/control/SaveControl.tsx
rename to autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/SaveControl.tsx
index ec580bf8dd..b645f852b3 100644
--- a/autogpt_platform/frontend/src/components/edit/control/SaveControl.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/SaveControl.tsx
@@ -14,11 +14,11 @@ import {
Tooltip,
TooltipContent,
TooltipTrigger,
-} from "@/components/ui/tooltip";
+} from "@/components/atoms/Tooltip/BaseTooltip";
import { useToast } from "@/components/molecules/Toast/use-toast";
import { useQueryClient } from "@tanstack/react-query";
import { getGetV2ListMySubmissionsQueryKey } from "@/app/api/__generated__/endpoints/store/store";
-import { CronExpressionDialog } from "@/components/cron-scheduler-dialog";
+import { CronExpressionDialog } from "@/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/cron-scheduler-dialog";
import { humanizeCronExpression } from "@/lib/cron-expression-utils";
import { CalendarClockIcon } from "lucide-react";
diff --git a/autogpt_platform/frontend/src/components/history.ts b/autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/history.ts
similarity index 94%
rename from autogpt_platform/frontend/src/components/history.ts
rename to autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/history.ts
index de0697a97e..9b855bdf69 100644
--- a/autogpt_platform/frontend/src/components/history.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/history.ts
@@ -1,5 +1,5 @@
-import { CustomNodeData } from "./CustomNode";
-import { CustomEdgeData } from "./CustomEdge";
+import { CustomNodeData } from "./CustomNode/CustomNode";
+import { CustomEdgeData } from "./CustomEdge/CustomEdge";
import { Edge } from "@xyflow/react";
type ActionType =
diff --git a/autogpt_platform/frontend/src/components/tutorial.ts b/autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/tutorial.ts
similarity index 100%
rename from autogpt_platform/frontend/src/components/tutorial.ts
rename to autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/tutorial.ts
diff --git a/autogpt_platform/frontend/src/app/(platform)/build/page.tsx b/autogpt_platform/frontend/src/app/(platform)/build/page.tsx
index 725cf6c77b..6c0e89218f 100644
--- a/autogpt_platform/frontend/src/app/(platform)/build/page.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/build/page.tsx
@@ -1,7 +1,7 @@
"use client";
-import FlowEditor from "@/components/Flow";
-import { useOnboarding } from "@/components/onboarding/onboarding-provider";
+import { useOnboarding } from "@/providers/onboarding/onboarding-provider";
+import FlowEditor from "@/app/(platform)/build/components/legacy-builder/Flow/Flow";
import LoadingBox from "@/components/ui/loading";
import { GraphID } from "@/lib/autogpt-server-api/types";
import { useSearchParams } from "next/navigation";
diff --git a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/AgentRunsView/components/AgentInputsReadOnly/AgentInputsReadOnly.tsx b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/AgentRunsView/components/AgentInputsReadOnly/AgentInputsReadOnly.tsx
index 0787d77592..1f59479208 100644
--- a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/AgentRunsView/components/AgentInputsReadOnly/AgentInputsReadOnly.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/AgentRunsView/components/AgentInputsReadOnly/AgentInputsReadOnly.tsx
@@ -3,7 +3,7 @@
import React from "react";
import type { LibraryAgent } from "@/app/api/__generated__/models/libraryAgent";
import type { CredentialsMetaInput } from "@/lib/autogpt-server-api/types";
-import { toDisplayName } from "@/services/agent-credentials/helper";
+import { toDisplayName } from "@/providers/agent-credentials/helper";
import {
getAgentCredentialsFields,
getAgentInputFields,
diff --git a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/AgentRunsView/components/CredentialsInputs/CredentialsInputs.tsx b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/AgentRunsView/components/CredentialsInputs/CredentialsInputs.tsx
index 71be8f7da9..d4d699404a 100644
--- a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/AgentRunsView/components/CredentialsInputs/CredentialsInputs.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/AgentRunsView/components/CredentialsInputs/CredentialsInputs.tsx
@@ -1,4 +1,3 @@
-import SchemaTooltip from "@/components/SchemaTooltip";
import { Button } from "@/components/atoms/Button/Button";
import { IconKey, IconKeyPlus, IconUserPlus } from "@/components/ui/icons";
import {
@@ -32,6 +31,7 @@ import { APIKeyCredentialsModal } from "../APIKeyCredentialsModal/APIKeyCredenti
import { HostScopedCredentialsModal } from "../HotScopedCredentialsModal/HotScopedCredentialsModal";
import { OAuthFlowWaitingModal } from "../OAuthWaitingModal/OAuthWaitingModal";
import { PasswordCredentialsModal } from "../PasswordCredentialsModal/PasswordCredentialsModal";
+import { InformationTooltip } from "@/components/molecules/InformationTooltip/InformationTooltip";
const fallbackIcon = FaKey;
@@ -328,7 +328,7 @@ export const CredentialsInput: FC<{
<span className="text-m green text-gray-900">
{providerName} Credentials
</span>
- <SchemaTooltip description={schema.description} />
+ <InformationTooltip description={schema.description} />
</div>
);
diff --git a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/AgentRunsView/components/RunAgentModal/components/ModalRunSection/ModalRunSection.tsx b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/AgentRunsView/components/RunAgentModal/components/ModalRunSection/ModalRunSection.tsx
index 720c88992c..8286bdf782 100644
--- a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/AgentRunsView/components/RunAgentModal/components/ModalRunSection/ModalRunSection.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/AgentRunsView/components/RunAgentModal/components/ModalRunSection/ModalRunSection.tsx
@@ -1,13 +1,13 @@
import { WebhookTriggerBanner } from "../WebhookTriggerBanner/WebhookTriggerBanner";
import { Input } from "@/components/atoms/Input/Input";
-import SchemaTooltip from "@/components/SchemaTooltip";
import { CredentialsInput } from "@/app/(platform)/library/agents/[id]/components/AgentRunsView/components/CredentialsInputs/CredentialsInputs";
import { useRunAgentModalContext } from "../../context";
import { RunAgentInputs } from "../../../RunAgentInputs/RunAgentInputs";
import { InfoIcon } from "@phosphor-icons/react";
import { Text } from "@/components/atoms/Text/Text";
-import { toDisplayName } from "@/services/agent-credentials/helper";
+import { toDisplayName } from "@/providers/agent-credentials/helper";
import { getCredentialTypeDisplayName } from "./helpers";
+import { InformationTooltip } from "@/components/molecules/InformationTooltip/InformationTooltip";
export function ModalRunSection() {
const {
@@ -35,7 +35,7 @@ export function ModalRunSection() {
<div className="flex flex-col space-y-2">
<label className="flex items-center gap-1 text-sm font-medium">
Trigger Name
- <SchemaTooltip description="Name of the trigger you are setting up" />
+ <InformationTooltip description="Name of the trigger you are setting up" />
</label>
<Input
id="trigger_name"
@@ -50,7 +50,7 @@ export function ModalRunSection() {
<div className="flex flex-col space-y-2">
<label className="flex items-center gap-1 text-sm font-medium">
Trigger Description
- <SchemaTooltip description="Description of the trigger you are setting up" />
+ <InformationTooltip description="Description of the trigger you are setting up" />
</label>
<Input
id="trigger_description"
@@ -104,7 +104,7 @@ export function ModalRunSection() {
<div key={key} className="flex w-full flex-col gap-0 space-y-2">
<label className="flex items-center gap-1 text-sm font-medium">
{inputSubSchema.title || key}
- <SchemaTooltip description={inputSubSchema.description} />
+ <InformationTooltip description={inputSubSchema.description} />
</label>
<RunAgentInputs
diff --git a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/AgentRunsView/components/RunDetailHeader/RunDetailHeader.tsx b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/AgentRunsView/components/RunDetailHeader/RunDetailHeader.tsx
index 3283b38b72..e49763a50f 100644
--- a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/AgentRunsView/components/RunDetailHeader/RunDetailHeader.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/AgentRunsView/components/RunDetailHeader/RunDetailHeader.tsx
@@ -14,8 +14,8 @@ import { GraphExecution } from "@/app/api/__generated__/models/graphExecution";
import { useRunDetailHeader } from "./useRunDetailHeader";
import { AgentActionsDropdown } from "../AgentActionsDropdown";
import { Dialog } from "@/components/molecules/Dialog/Dialog";
-import { ShareButton } from "@/components/ShareButton";
import { Flag, useGetFlag } from "@/services/feature-flags/use-get-flag";
+import { ShareRunButton } from "../ShareRunButton/ShareRunButton";
type Props = {
agent: LibraryAgent;
@@ -73,7 +73,7 @@ export function RunDetailHeader({
<PlayIcon size={16} /> Run again
</Button>
{shareExecutionResultsEnabled && (
- <ShareButton
+ <ShareRunButton
graphId={agent.graph_id}
executionId={run.id}
isShared={run.is_shared}
diff --git a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/AgentRunsView/components/ShareRunButton/ShareRunButton.tsx b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/AgentRunsView/components/ShareRunButton/ShareRunButton.tsx
new file mode 100644
index 0000000000..d813b713c0
--- /dev/null
+++ b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/AgentRunsView/components/ShareRunButton/ShareRunButton.tsx
@@ -0,0 +1,134 @@
+"use client";
+
+import React from "react";
+import { Button } from "@/components/atoms/Button/Button";
+import { Dialog } from "@/components/molecules/Dialog/Dialog";
+import { Alert, AlertDescription } from "@/components/ui/alert";
+import {
+ ShareFatIcon,
+ CopyIcon,
+ CheckIcon,
+ WarningIcon,
+} from "@phosphor-icons/react";
+import { useShareRunButton } from "./useShareRunButton";
+import { Input } from "@/components/atoms/Input/Input";
+import { Text } from "@/components/atoms/Text/Text";
+
+interface Props {
+ graphId: string;
+ executionId: string;
+ isShared?: boolean;
+ shareToken?: string | null;
+}
+
+export function ShareRunButton({
+ graphId,
+ executionId,
+ isShared: initialIsShared = false,
+ shareToken: initialShareToken,
+}: Props) {
+ const {
+ isShared,
+ shareUrl,
+ copied,
+ loading,
+ handleShare,
+ handleStopSharing,
+ handleCopy,
+ } = useShareRunButton({
+ graphId,
+ executionId,
+ isShared: initialIsShared,
+ shareToken: initialShareToken,
+ });
+
+ return (
+ <Dialog
+ title="Share Agent Run"
+ styling={{ maxWidth: "36rem", minWidth: "auto" }}
+ >
+ <Dialog.Trigger>
+ <Button
+ variant={isShared ? "primary" : "secondary"}
+ size="small"
+ className={isShared ? "relative" : ""}
+ >
+ <ShareFatIcon size={16} />
+ {isShared ? "Shared" : "Share"}
+ </Button>
+ </Dialog.Trigger>
+
+ <Dialog.Content>
+ <div className="flex flex-col gap-4">
+ <Text variant="large">
+ {isShared
+ ? "Your agent run is currently shared. Anyone with the link can view the output."
+ : "Generate a public link to share this agent run output with others."}
+ </Text>
+
+ {!isShared ? (
+ <>
+ <div className="!mb-4">
+ <Alert>
+ <WarningIcon className="h-4 w-4" />
+ <Text variant="body">
+ When you enable sharing, the output of this agent run will
+ be publicly accessible to anyone with the link. The page
+ will include a noindex directive to discourage search engine
+ crawling, but this cannot be guaranteed.
+ </Text>
+ </Alert>
+ </div>
+ <Button
+ onClick={handleShare}
+ loading={loading}
+ className="mt-6 w-full"
+ >
+ Enable Sharing
+ </Button>
+ </>
+ ) : (
+ <>
+ <div className="flex w-full items-center gap-4">
+ <Input
+ type="text"
+ value={shareUrl}
+ readOnly
+ label="Share URL"
+ id="share-url"
+ size="small"
+ className="!m-0"
+ wrapperClassName="flex-1"
+ />
+ <Button
+ variant="secondary"
+ onClick={handleCopy}
+ size="small"
+ className="mt-0.5 !min-w-0"
+ >
+ {copied ? <CheckIcon size={16} /> : <CopyIcon size={16} />}
+ </Button>
+ </div>
+ <Alert>
+ <WarningIcon className="h-4 w-4" />
+ <AlertDescription>
+ This link is publicly accessible. Only share it with people
+ you trust. The shared page includes noindex directives to
+ discourage search engines.
+ </AlertDescription>
+ </Alert>
+ <Button
+ onClick={handleStopSharing}
+ loading={loading}
+ variant="destructive"
+ className="mt-6 w-full"
+ >
+ Stop Sharing
+ </Button>
+ </>
+ )}
+ </div>
+ </Dialog.Content>
+ </Dialog>
+ );
+}
diff --git a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/AgentRunsView/components/ShareRunButton/useShareRunButton.ts b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/AgentRunsView/components/ShareRunButton/useShareRunButton.ts
new file mode 100644
index 0000000000..2a07f9bee6
--- /dev/null
+++ b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/AgentRunsView/components/ShareRunButton/useShareRunButton.ts
@@ -0,0 +1,127 @@
+import { useState, useEffect } from "react";
+import {
+ usePostV1EnableExecutionSharing,
+ useDeleteV1DisableExecutionSharing,
+} from "@/app/api/__generated__/endpoints/default/default";
+import { useToast } from "@/components/molecules/Toast/use-toast";
+
+interface UseShareRunButtonProps {
+ graphId: string;
+ executionId: string;
+ isShared?: boolean;
+ shareToken?: string | null;
+}
+
+export function useShareRunButton({
+ graphId,
+ executionId,
+ isShared: initialIsShared = false,
+ shareToken: initialShareToken,
+}: UseShareRunButtonProps) {
+ const [isShared, setIsShared] = useState(initialIsShared);
+ const [shareToken, setShareToken] = useState(initialShareToken || null);
+ const [copied, setCopied] = useState(false);
+ const { toast } = useToast();
+
+ // Sync state when props change (e.g., after re-fetching run data)
+ useEffect(() => {
+ setIsShared(initialIsShared);
+ setShareToken(initialShareToken || null);
+ }, [initialIsShared, initialShareToken]);
+
+ // Generate the share URL from the token
+ const baseUrl =
+ process.env.NEXT_PUBLIC_FRONTEND_BASE_URL || window.location.origin;
+
+ const shareUrl = shareToken ? `${baseUrl}/share/${shareToken}` : "";
+
+ const { mutateAsync: enableSharing, isPending: isEnabling } =
+ usePostV1EnableExecutionSharing();
+ const { mutateAsync: disableSharing, isPending: isDisabling } =
+ useDeleteV1DisableExecutionSharing();
+
+ const loading = isEnabling || isDisabling;
+
+ async function handleShare() {
+ try {
+ const response = await enableSharing({
+ graphId,
+ graphExecId: executionId,
+ data: {}, // Empty ShareRequest
+ });
+
+ if (response.status === 200) {
+ setShareToken(response.data.share_token);
+ setIsShared(true);
+ toast({
+ title: "Sharing enabled",
+ description:
+ "Your agent run is now publicly accessible via the share link.",
+ });
+ } else {
+ toast({
+ title: "Error",
+ description: "Failed to enable sharing. Please try again.",
+ variant: "destructive",
+ });
+ }
+ } catch {
+ toast({
+ title: "Error",
+ description: "Failed to enable sharing. Please try again.",
+ variant: "destructive",
+ });
+ }
+ }
+
+ async function handleStopSharing() {
+ try {
+ await disableSharing({
+ graphId,
+ graphExecId: executionId,
+ });
+
+ setIsShared(false);
+ setShareToken(null);
+ toast({
+ title: "Sharing disabled",
+ description: "The share link is no longer accessible.",
+ });
+ } catch {
+ toast({
+ title: "Error",
+ description: "Failed to disable sharing. Please try again.",
+ variant: "destructive",
+ });
+ }
+ }
+
+ async function handleCopy() {
+ try {
+ await navigator.clipboard.writeText(shareUrl);
+ setCopied(true);
+ setTimeout(() => setCopied(false), 2000);
+ toast({
+ title: "Copied!",
+ description: "Share link copied to clipboard.",
+ });
+ } catch {
+ toast({
+ title: "Error",
+ description: "Failed to copy link. Please try again.",
+ variant: "destructive",
+ });
+ }
+ }
+
+ return {
+ isShared,
+ shareToken,
+ shareUrl,
+ copied,
+ loading,
+ handleShare,
+ handleStopSharing,
+ handleCopy,
+ };
+}
diff --git a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/OldAgentLibraryView.tsx b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/OldAgentLibraryView.tsx
index 30ee2a803c..47f5128f3b 100644
--- a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/OldAgentLibraryView.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/OldAgentLibraryView.tsx
@@ -27,7 +27,6 @@ import { exportAsJSONFile } from "@/lib/utils";
import DeleteConfirmDialog from "@/components/agptui/delete-confirm-dialog";
import type { ButtonAction } from "@/components/agptui/types";
-import { useOnboarding } from "@/components/onboarding/onboarding-provider";
import { Button } from "@/components/ui/button";
import {
Dialog,
@@ -48,6 +47,7 @@ import { CreatePresetDialog } from "./components/create-preset-dialog";
import { useAgentRunsInfinite } from "./use-agent-runs";
import { AgentRunsSelectorList } from "./components/agent-runs-selector-list";
import { AgentScheduleDetailsView } from "./components/agent-schedule-details-view";
+import { useOnboarding } from "@/providers/onboarding/onboarding-provider";
export function OldAgentLibraryView() {
const { id: agentID }: { id: LibraryAgentID } = useParams();
diff --git a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/agent-run-details-view.tsx b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/agent-run-details-view.tsx
index 2671b8b51e..eae2057874 100644
--- a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/agent-run-details-view.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/agent-run-details-view.tsx
@@ -26,7 +26,7 @@ import {
TooltipContent,
TooltipProvider,
TooltipTrigger,
-} from "@/components/ui/tooltip";
+} from "@/components/atoms/Tooltip/BaseTooltip";
import { useToastOnFail } from "@/components/molecules/Toast/use-toast";
import { AgentRunStatus, agentRunStatusMap } from "./agent-run-status-chip";
diff --git a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/agent-run-draft-view.tsx b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/agent-run-draft-view.tsx
index 995214424c..6019b2f515 100644
--- a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/agent-run-draft-view.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/agent-run-draft-view.tsx
@@ -19,12 +19,11 @@ import { IconCross, IconPlay, IconSave } from "@/components/ui/icons";
import { CalendarClockIcon, Trash2Icon } from "lucide-react";
import { ClockIcon, InfoIcon } from "@phosphor-icons/react";
import { humanizeCronExpression } from "@/lib/cron-expression-utils";
-import { ScheduleTaskDialog } from "@/components/cron-scheduler-dialog";
+import { ScheduleTaskDialog } from "@/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/cron-scheduler-dialog";
import { CredentialsInput } from "@/app/(platform)/library/agents/[id]/components/AgentRunsView/components/CredentialsInputs/CredentialsInputs";
import { RunAgentInputs } from "@/app/(platform)/library/agents/[id]/components/AgentRunsView/components/RunAgentInputs/RunAgentInputs";
-import { useOnboarding } from "@/components/onboarding/onboarding-provider";
import { cn, isEmpty } from "@/lib/utils";
-import SchemaTooltip from "@/components/SchemaTooltip";
+import { InformationTooltip } from "@/components/molecules/InformationTooltip/InformationTooltip";
import { CopyIcon } from "@phosphor-icons/react";
import { Button } from "@/components/atoms/Button/Button";
import { Input } from "@/components/ui/input";
@@ -34,6 +33,7 @@ import {
} from "@/components/molecules/Toast/use-toast";
import { AgentStatus, AgentStatusChip } from "./agent-status-chip";
+import { useOnboarding } from "@/providers/onboarding/onboarding-provider";
export function AgentRunDraftView({
graph,
@@ -607,7 +607,7 @@ export function AgentRunDraftView({
<div className="flex flex-col space-y-2">
<label className="flex items-center gap-1 text-sm font-medium">
{graph.has_external_trigger ? "Trigger" : "Preset"} Name
- <SchemaTooltip
+ <InformationTooltip
description={`Name of the ${graph.has_external_trigger ? "trigger" : "preset"} you are setting up`}
/>
</label>
@@ -624,7 +624,7 @@ export function AgentRunDraftView({
<label className="flex items-center gap-1 text-sm font-medium">
{graph.has_external_trigger ? "Trigger" : "Preset"}{" "}
Description
- <SchemaTooltip
+ <InformationTooltip
description={`Description of the ${graph.has_external_trigger ? "trigger" : "preset"} you are setting up`}
/>
</label>
@@ -679,7 +679,9 @@ export function AgentRunDraftView({
<div key={key} className="flex flex-col space-y-2">
<label className="flex items-center gap-1 text-sm font-medium">
{inputSubSchema.title || key}
- <SchemaTooltip description={inputSubSchema.description} />
+ <InformationTooltip
+ description={inputSubSchema.description}
+ />
</label>
<RunAgentInputs
diff --git a/autogpt_platform/frontend/src/components/cron-scheduler-dialog.tsx b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/cron-scheduler-dialog.tsx
similarity index 97%
rename from autogpt_platform/frontend/src/components/cron-scheduler-dialog.tsx
rename to autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/cron-scheduler-dialog.tsx
index 6af0563afc..3aa1381495 100644
--- a/autogpt_platform/frontend/src/components/cron-scheduler-dialog.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/cron-scheduler-dialog.tsx
@@ -2,7 +2,7 @@ import { useEffect, useState } from "react";
import { Input } from "@/components/ui/input";
import { Button } from "@/components/ui/button";
import { useToast } from "@/components/molecules/Toast/use-toast";
-import { CronScheduler } from "@/components/cron-scheduler";
+import { CronScheduler } from "@/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/cron-scheduler";
import { Dialog } from "@/components/molecules/Dialog/Dialog";
import { useGetV1GetUserTimezone } from "@/app/api/__generated__/endpoints/auth/auth";
import { getTimezoneDisplayName } from "@/lib/timezone-utils";
diff --git a/autogpt_platform/frontend/src/components/cron-scheduler.tsx b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/cron-scheduler.tsx
similarity index 100%
rename from autogpt_platform/frontend/src/components/cron-scheduler.tsx
rename to autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/cron-scheduler.tsx
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/AgentInfo/useAgentInfo.ts b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/AgentInfo/useAgentInfo.ts
index 8896e0593f..2b5a4029d3 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/AgentInfo/useAgentInfo.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/AgentInfo/useAgentInfo.ts
@@ -3,8 +3,8 @@ import { LibraryAgent } from "@/app/api/__generated__/models/libraryAgent";
import { useToast } from "@/components/molecules/Toast/use-toast";
import { useRouter } from "next/navigation";
import * as Sentry from "@sentry/nextjs";
-import { useOnboarding } from "@/components/onboarding/onboarding-provider";
import { useGetV2DownloadAgentFile } from "@/app/api/__generated__/endpoints/store/store";
+import { useOnboarding } from "@/providers/onboarding/onboarding-provider";
interface UseAgentInfoProps {
storeListingVersionId: string;
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/HeroSection/useHeroSection.ts b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/HeroSection/useHeroSection.ts
index 75d84c51a0..03798efd8e 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/HeroSection/useHeroSection.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/HeroSection/useHeroSection.ts
@@ -1,4 +1,4 @@
-import { useOnboarding } from "@/components/onboarding/onboarding-provider";
+import { useOnboarding } from "@/providers/onboarding/onboarding-provider";
import { useRouter } from "next/navigation";
import { useEffect } from "react";
diff --git a/autogpt_platform/frontend/src/app/(platform)/monitoring/components/AgentFlowList.tsx b/autogpt_platform/frontend/src/app/(platform)/monitoring/components/AgentFlowList.tsx
index 8085552cba..38f9610c9d 100644
--- a/autogpt_platform/frontend/src/app/(platform)/monitoring/components/AgentFlowList.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/monitoring/components/AgentFlowList.tsx
@@ -17,7 +17,6 @@ import {
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu";
import { ChevronDownIcon, EnterIcon } from "@radix-ui/react-icons";
-import { AgentImportForm } from "@/components/agent-import-form";
import {
Table,
TableBody,
@@ -28,6 +27,7 @@ import {
} from "@/components/ui/table";
import moment from "moment/moment";
import { DialogTitle } from "@/components/ui/dialog";
+import { AgentImportForm } from "./AgentImportForm";
export const AgentFlowList = ({
flows,
diff --git a/autogpt_platform/frontend/src/components/agent-import-form.tsx b/autogpt_platform/frontend/src/app/(platform)/monitoring/components/AgentImportForm.tsx
similarity index 100%
rename from autogpt_platform/frontend/src/components/agent-import-form.tsx
rename to autogpt_platform/frontend/src/app/(platform)/monitoring/components/AgentImportForm.tsx
diff --git a/autogpt_platform/frontend/src/app/(platform)/monitoring/components/FlowInfo.tsx b/autogpt_platform/frontend/src/app/(platform)/monitoring/components/FlowInfo.tsx
index b07702c3a3..2a0ba48708 100644
--- a/autogpt_platform/frontend/src/app/(platform)/monitoring/components/FlowInfo.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/monitoring/components/FlowInfo.tsx
@@ -34,8 +34,8 @@ import {
} from "@/components/ui/dialog";
import useAgentGraph from "@/hooks/useAgentGraph";
import { useBackendAPI } from "@/lib/autogpt-server-api/context";
-import { RunnerInputDialog } from "@/components/runner-ui/RunnerInputUI";
import { FlowRunsStatus } from "./FlowRunsStatus";
+import { RunnerInputDialog } from "../../build/components/legacy-builder/RunnerInputUI";
export const FlowInfo: React.FC<
React.HTMLAttributes<HTMLDivElement> & {
diff --git a/autogpt_platform/frontend/src/app/(platform)/monitoring/components/FlowRunInfo.tsx b/autogpt_platform/frontend/src/app/(platform)/monitoring/components/FlowRunInfo.tsx
index be0d009a51..63ec577cdd 100644
--- a/autogpt_platform/frontend/src/app/(platform)/monitoring/components/FlowRunInfo.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/monitoring/components/FlowRunInfo.tsx
@@ -7,10 +7,10 @@ import { IconSquare } from "@/components/ui/icons";
import { ExitIcon, Pencil2Icon } from "@radix-ui/react-icons";
import moment from "moment/moment";
import { FlowRunStatusBadge } from "@/app/(platform)/monitoring/components/FlowRunStatusBadge";
+import { useBackendAPI } from "@/lib/autogpt-server-api/context";
import RunnerOutputUI, {
OutputNodeInfo,
-} from "../../../../components/runner-ui/RunnerOutputUI";
-import { useBackendAPI } from "@/lib/autogpt-server-api/context";
+} from "../../build/components/legacy-builder/RunnerOutputUI";
export const FlowRunInfo: React.FC<
React.HTMLAttributes<HTMLDivElement> & {
diff --git a/autogpt_platform/frontend/src/app/(platform)/profile/(user)/integrations/page.tsx b/autogpt_platform/frontend/src/app/(platform)/profile/(user)/integrations/page.tsx
index 433334ddb7..135c2cf543 100644
--- a/autogpt_platform/frontend/src/app/(platform)/profile/(user)/integrations/page.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/profile/(user)/integrations/page.tsx
@@ -7,7 +7,7 @@ import { IconKey, IconUser } from "@/components/ui/icons";
import { Trash2Icon } from "lucide-react";
import { KeyIcon } from "@phosphor-icons/react/dist/ssr";
import { providerIcons } from "@/app/(platform)/library/agents/[id]/components/AgentRunsView/components/CredentialsInputs/CredentialsInputs";
-import { CredentialsProvidersContext } from "@/services/agent-credentials/credentials-provider";
+import { CredentialsProvidersContext } from "@/providers/agent-credentials/credentials-provider";
import {
Table,
TableBody,
diff --git a/autogpt_platform/frontend/src/app/layout.tsx b/autogpt_platform/frontend/src/app/layout.tsx
index 2ed896eb6f..77973a54e6 100644
--- a/autogpt_platform/frontend/src/app/layout.tsx
+++ b/autogpt_platform/frontend/src/app/layout.tsx
@@ -5,7 +5,7 @@ import React from "react";
import "./globals.css";
import { Providers } from "@/app/providers";
-import TallyPopupSimple from "@/components/TallyPopup";
+import TallyPopupSimple from "@/components/molecules/TallyPoup/TallyPopup";
import { GoogleAnalytics } from "@/services/analytics/google-analytics";
import { Toaster } from "@/components/molecules/Toast/toaster";
import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
diff --git a/autogpt_platform/frontend/src/app/providers.tsx b/autogpt_platform/frontend/src/app/providers.tsx
index a9023b781c..d6c29545fd 100644
--- a/autogpt_platform/frontend/src/app/providers.tsx
+++ b/autogpt_platform/frontend/src/app/providers.tsx
@@ -1,9 +1,7 @@
"use client";
import { LaunchDarklyProvider } from "@/services/feature-flags/feature-flag-provider";
-import CredentialsProvider from "@/services/agent-credentials/credentials-provider";
-import OnboardingProvider from "@/components/onboarding/onboarding-provider";
-import { TooltipProvider } from "@/components/ui/tooltip";
+import OnboardingProvider from "@/providers/onboarding/onboarding-provider";
import { BackendAPIProvider } from "@/lib/autogpt-server-api/context";
import { getQueryClient } from "@/lib/react-query/queryClient";
import { QueryClientProvider } from "@tanstack/react-query";
@@ -12,6 +10,8 @@ import {
ThemeProviderProps,
} from "next-themes";
import { NuqsAdapter } from "nuqs/adapters/next/app";
+import { TooltipProvider } from "@/components/atoms/Tooltip/BaseTooltip";
+import CredentialsProvider from "@/providers/agent-credentials/credentials-provider";
export function Providers({ children, ...props }: ThemeProviderProps) {
const queryClient = getQueryClient();
diff --git a/autogpt_platform/frontend/src/components/RoleBasedAccess.tsx b/autogpt_platform/frontend/src/components/RoleBasedAccess.tsx
deleted file mode 100644
index b31e4dd08b..0000000000
--- a/autogpt_platform/frontend/src/components/RoleBasedAccess.tsx
+++ /dev/null
@@ -1,27 +0,0 @@
-// components/RoleBasedAccess.tsx
-import { useSupabase } from "@/lib/supabase/hooks/useSupabase";
-import React from "react";
-
-interface RoleBasedAccessProps {
- allowedRoles: string[];
- children: React.ReactNode;
-}
-
-const RoleBasedAccess: React.FC<RoleBasedAccessProps> = ({
- allowedRoles,
- children,
-}) => {
- const { user, isUserLoading } = useSupabase();
-
- if (isUserLoading) {
- return <div>Loading...</div>;
- }
-
- if (!user!.role || !allowedRoles.includes(user!.role)) {
- return null;
- }
-
- return <>{children}</>;
-};
-
-export default RoleBasedAccess;
diff --git a/autogpt_platform/frontend/src/components/ShareButton.tsx b/autogpt_platform/frontend/src/components/ShareButton.tsx
deleted file mode 100644
index 95b7beafa8..0000000000
--- a/autogpt_platform/frontend/src/components/ShareButton.tsx
+++ /dev/null
@@ -1,223 +0,0 @@
-"use client";
-
-import React, { useState, useEffect } from "react";
-import { Button } from "@/components/atoms/Button/Button";
-import {
- Dialog,
- DialogContent,
- DialogDescription,
- DialogHeader,
- DialogTitle,
- DialogTrigger,
-} from "@/components/ui/dialog";
-import { Input } from "@/components/ui/input";
-import { Alert, AlertDescription } from "@/components/ui/alert";
-import {
- ShareFatIcon,
- CopyIcon,
- CheckIcon,
- WarningIcon,
-} from "@phosphor-icons/react";
-import { useToast } from "./molecules/Toast/use-toast";
-import {
- usePostV1EnableExecutionSharing,
- useDeleteV1DisableExecutionSharing,
-} from "@/app/api/__generated__/endpoints/default/default";
-
-interface ShareButtonProps {
- graphId: string;
- executionId: string;
- isShared?: boolean;
- shareToken?: string | null;
-}
-
-export function ShareButton({
- graphId,
- executionId,
- isShared: initialIsShared = false,
- shareToken: initialShareToken,
-}: ShareButtonProps) {
- const [isOpen, setIsOpen] = useState(false);
- const [isShared, setIsShared] = useState(initialIsShared);
- const [shareToken, setShareToken] = useState(initialShareToken || null);
- const [copied, setCopied] = useState(false);
- const { toast } = useToast();
-
- // Sync state when props change (e.g., after re-fetching run data)
- useEffect(() => {
- setIsShared(initialIsShared);
- setShareToken(initialShareToken || null);
- }, [initialIsShared, initialShareToken]);
-
- // Generate the share URL from the token
- const baseUrl =
- process.env.NEXT_PUBLIC_FRONTEND_BASE_URL || window.location.origin;
- const shareUrl = shareToken ? `${baseUrl}/share/${shareToken}` : "";
-
- const { mutate: enableSharing, isPending: isEnabling } =
- usePostV1EnableExecutionSharing();
- const { mutate: disableSharing, isPending: isDisabling } =
- useDeleteV1DisableExecutionSharing();
-
- const loading = isEnabling || isDisabling;
-
- const handleShare = () => {
- enableSharing(
- {
- graphId,
- graphExecId: executionId,
- data: {}, // Empty ShareRequest
- },
- {
- onSuccess: (response) => {
- if (response.status === 200) {
- setShareToken(response.data.share_token);
- setIsShared(true);
- toast({
- title: "Sharing enabled",
- description:
- "Your agent run is now publicly accessible via the share link.",
- });
- } else {
- toast({
- title: "Error",
- description: "Failed to enable sharing. Please try again.",
- variant: "destructive",
- });
- }
- },
- onError: () => {
- toast({
- title: "Error",
- description: "Failed to enable sharing. Please try again.",
- variant: "destructive",
- });
- },
- },
- );
- };
-
- const handleStopSharing = () => {
- disableSharing(
- {
- graphId,
- graphExecId: executionId,
- },
- {
- onSuccess: () => {
- setIsShared(false);
- setShareToken(null);
- toast({
- title: "Sharing disabled",
- description: "The share link is no longer accessible.",
- });
- },
- onError: () => {
- toast({
- title: "Error",
- description: "Failed to disable sharing. Please try again.",
- variant: "destructive",
- });
- },
- },
- );
- };
-
- const handleCopy = async () => {
- try {
- await navigator.clipboard.writeText(shareUrl);
- setCopied(true);
- setTimeout(() => setCopied(false), 2000);
- toast({
- title: "Copied!",
- description: "Share link copied to clipboard.",
- });
- } catch {
- toast({
- title: "Error",
- description: "Failed to copy link. Please try again.",
- variant: "destructive",
- });
- }
- };
-
- return (
- <Dialog open={isOpen} onOpenChange={setIsOpen}>
- <DialogTrigger asChild>
- <Button
- variant={isShared ? "primary" : "secondary"}
- size="small"
- className={isShared ? "relative" : ""}
- >
- <ShareFatIcon size={16} />
- {isShared ? "Shared" : "Share"}
- {isShared && (
- <span className="absolute -right-1 -top-1 h-2 w-2 rounded-full bg-green-500" />
- )}
- </Button>
- </DialogTrigger>
- <DialogContent className="sm:max-w-md">
- <DialogHeader>
- <DialogTitle>Share Agent Run</DialogTitle>
- <DialogDescription>
- {isShared
- ? "Your agent run is currently shared. Anyone with the link can view the output."
- : "Generate a public link to share this agent run output with others."}
- </DialogDescription>
- </DialogHeader>
-
- <div className="space-y-4">
- {!isShared ? (
- <>
- <Alert>
- <WarningIcon className="h-4 w-4" />
- <AlertDescription>
- When you enable sharing, the output of this agent run will be
- publicly accessible to anyone with the link. The page will
- include a noindex directive to discourage search engine
- crawling, but this cannot be guaranteed.
- </AlertDescription>
- </Alert>
- <Button
- onClick={handleShare}
- loading={loading}
- className="w-full"
- >
- Enable Sharing
- </Button>
- </>
- ) : (
- <>
- <div className="flex items-center space-x-2">
- <Input value={shareUrl} readOnly className="flex-1" />
- <button
- onClick={handleCopy}
- className="inline-flex h-10 w-10 items-center justify-center rounded-md border border-input bg-background text-sm font-medium ring-offset-background transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"
- type="button"
- >
- {copied ? <CheckIcon size={16} /> : <CopyIcon size={16} />}
- </button>
- </div>
- <Alert>
- <WarningIcon className="h-4 w-4" />
- <AlertDescription>
- This link is publicly accessible. Only share it with people
- you trust. The shared page includes noindex directives to
- discourage search engines.
- </AlertDescription>
- </Alert>
- <Button
- onClick={handleStopSharing}
- loading={loading}
- variant="destructive"
- className="w-full"
- >
- Stop Sharing
- </Button>
- </>
- )}
- </div>
- </DialogContent>
- </Dialog>
- );
-}
diff --git a/autogpt_platform/frontend/src/components/agptui/AgentInfo.tsx b/autogpt_platform/frontend/src/components/agptui/AgentInfo.tsx
index 2b680649e0..6806ff56bb 100644
--- a/autogpt_platform/frontend/src/components/agptui/AgentInfo.tsx
+++ b/autogpt_platform/frontend/src/components/agptui/AgentInfo.tsx
@@ -7,7 +7,7 @@ import { useRouter } from "next/navigation";
import Link from "next/link";
import { useToast } from "@/components/molecules/Toast/use-toast";
-import { useOnboarding } from "../onboarding/onboarding-provider";
+import { useOnboarding } from "@/providers/onboarding/onboarding-provider";
import { User } from "@supabase/supabase-js";
import { cn } from "@/lib/utils";
import { FC, useCallback, useMemo, useState } from "react";
diff --git a/autogpt_platform/frontend/src/components/agptui/Wallet.tsx b/autogpt_platform/frontend/src/components/agptui/Wallet.tsx
index 36448bcc36..2be9d1276a 100644
--- a/autogpt_platform/frontend/src/components/agptui/Wallet.tsx
+++ b/autogpt_platform/frontend/src/components/agptui/Wallet.tsx
@@ -8,9 +8,9 @@ import {
} from "@/components/ui/popover";
import { X } from "lucide-react";
import { PopoverClose } from "@radix-ui/react-popover";
-import { TaskGroups } from "../onboarding/WalletTaskGroups";
+import { TaskGroups } from "@/app/(no-navbar)/onboarding/components/WalletTaskGroups";
import { ScrollArea } from "../ui/scroll-area";
-import { useOnboarding } from "../onboarding/onboarding-provider";
+import { useOnboarding } from "@/providers/onboarding/onboarding-provider";
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
import { cn } from "@/lib/utils";
import * as party from "party-js";
diff --git a/autogpt_platform/frontend/src/components/agptui/composite/HeroSection.tsx b/autogpt_platform/frontend/src/components/agptui/composite/HeroSection.tsx
index d23369e11d..aea1a6e750 100644
--- a/autogpt_platform/frontend/src/components/agptui/composite/HeroSection.tsx
+++ b/autogpt_platform/frontend/src/components/agptui/composite/HeroSection.tsx
@@ -4,7 +4,7 @@ import * as React from "react";
import { SearchBar } from "@/components/agptui/SearchBar";
import { FilterChips } from "@/components/agptui/FilterChips";
import { useRouter } from "next/navigation";
-import { useOnboarding } from "@/components/onboarding/onboarding-provider";
+import { useOnboarding } from "@/providers/onboarding/onboarding-provider";
export const HeroSection: React.FC = () => {
const router = useRouter();
diff --git a/autogpt_platform/frontend/src/components/atoms/Button/helpers.ts b/autogpt_platform/frontend/src/components/atoms/Button/helpers.ts
index 8029097369..6840afaae5 100644
--- a/autogpt_platform/frontend/src/components/atoms/Button/helpers.ts
+++ b/autogpt_platform/frontend/src/components/atoms/Button/helpers.ts
@@ -17,12 +17,12 @@ export const extendedButtonVariants = cva(
"bg-transparent border-zinc-700 text-black hover:bg-zinc-100 hover:border-zinc-700 rounded-full disabled:border-zinc-200 disabled:text-zinc-200 disabled:opacity-1",
ghost:
"bg-transparent border-transparent text-black hover:bg-zinc-50 hover:border-zinc-50 rounded-full disabled:text-zinc-200 disabled:opacity-1",
- icon: "bg-white text-black border border-zinc-600 hover:bg-zinc-100 rounded-[96px] disabled:opacity-1 min-w-0",
+ icon: "bg-white text-black border border-zinc-600 hover:bg-zinc-100 rounded-[96px] disabled:opacity-1 !min-w-0",
},
size: {
small: "px-3 py-2 text-sm gap-1.5 h-[2.25rem]",
large: "px-4 py-3 text-sm gap-2 h-[3.25rem]",
- icon: "p-3 min-w-0",
+ icon: "p-3 !min-w-0",
},
},
defaultVariants: {
diff --git a/autogpt_platform/frontend/src/components/ui/tooltip.tsx b/autogpt_platform/frontend/src/components/atoms/Tooltip/BaseTooltip.tsx
similarity index 69%
rename from autogpt_platform/frontend/src/components/ui/tooltip.tsx
rename to autogpt_platform/frontend/src/components/atoms/Tooltip/BaseTooltip.tsx
index 016d329d5c..12bf90ff13 100644
--- a/autogpt_platform/frontend/src/components/ui/tooltip.tsx
+++ b/autogpt_platform/frontend/src/components/atoms/Tooltip/BaseTooltip.tsx
@@ -29,7 +29,7 @@ const TooltipContent = React.forwardRef<
ref={ref}
sideOffset={sideOffset}
className={cn(
- "z-50 overflow-hidden rounded-md bg-neutral-900 px-3 py-1.5 text-xs text-neutral-50 animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:bg-neutral-50 dark:text-neutral-900",
+ "z-50 max-w-xs overflow-hidden rounded-md border border-slate-50 bg-white px-3 py-1.5 text-xs text-gray-900 animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
className,
)}
{...props}
diff --git a/autogpt_platform/frontend/src/components/atoms/Tooltip/Tooltip.stories.tsx b/autogpt_platform/frontend/src/components/atoms/Tooltip/Tooltip.stories.tsx
new file mode 100644
index 0000000000..ea6ec0f895
--- /dev/null
+++ b/autogpt_platform/frontend/src/components/atoms/Tooltip/Tooltip.stories.tsx
@@ -0,0 +1,260 @@
+import type { Meta, StoryObj } from "@storybook/nextjs";
+import { Button } from "../Button/Button";
+import {
+ Tooltip,
+ TooltipTrigger,
+ TooltipContent,
+ TooltipProvider,
+} from "./BaseTooltip";
+
+const meta: Meta<typeof Tooltip> = {
+ title: "Atoms/Tooltip",
+ tags: ["autodocs"],
+ component: Tooltip,
+ parameters: {
+ layout: "centered",
+ docs: {
+ description: {
+ component:
+ "Tooltip component built on Radix UI primitives. Provides contextual information on hover with customizable delay and positioning. Includes TooltipProvider, Tooltip, TooltipTrigger, and TooltipContent components.",
+ },
+ },
+ },
+ argTypes: {
+ delayDuration: {
+ control: { type: "number", min: 0, max: 2000, step: 100 },
+ description: "Delay in milliseconds before tooltip appears",
+ },
+ children: {
+ control: false,
+ description: "Tooltip content and trigger elements",
+ },
+ },
+ args: {
+ delayDuration: 10,
+ },
+};
+
+export default meta;
+type Story = StoryObj<typeof meta>;
+
+export const Default: Story = {
+ render: function DefaultTooltip(args) {
+ return (
+ <TooltipProvider>
+ <Tooltip delayDuration={args.delayDuration}>
+ <TooltipTrigger asChild>
+ <Button variant="secondary">Hover me</Button>
+ </TooltipTrigger>
+ <TooltipContent>
+ <p>This is a tooltip</p>
+ </TooltipContent>
+ </Tooltip>
+ </TooltipProvider>
+ );
+ },
+};
+
+export const WithDelay: Story = {
+ render: function DelayedTooltip() {
+ return (
+ <TooltipProvider>
+ <Tooltip delayDuration={1000}>
+ <TooltipTrigger asChild>
+ <Button variant="secondary">Hover me (1s delay)</Button>
+ </TooltipTrigger>
+ <TooltipContent>
+ <p>This tooltip appears after 1 second</p>
+ </TooltipContent>
+ </Tooltip>
+ </TooltipProvider>
+ );
+ },
+ parameters: {
+ docs: {
+ description: {
+ story:
+ "Tooltip with a longer delay duration to demonstrate the timing control.",
+ },
+ },
+ },
+};
+
+export const LongContent: Story = {
+ render: function LongContentTooltip() {
+ return (
+ <TooltipProvider>
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <Button variant="secondary">Long content</Button>
+ </TooltipTrigger>
+ <TooltipContent className="max-w-xs">
+ <p>
+ This is a tooltip with longer content that demonstrates how the
+ tooltip handles text wrapping and maintains readability with
+ extended descriptions.
+ </p>
+ </TooltipContent>
+ </Tooltip>
+ </TooltipProvider>
+ );
+ },
+};
+
+export const DifferentSides: Story = {
+ render: function DifferentSidesTooltip() {
+ return (
+ <div className="flex items-center gap-8">
+ <TooltipProvider>
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <Button variant="secondary" size="small">
+ Top
+ </Button>
+ </TooltipTrigger>
+ <TooltipContent side="top">
+ <p>Tooltip on top</p>
+ </TooltipContent>
+ </Tooltip>
+ </TooltipProvider>
+
+ <TooltipProvider>
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <Button variant="secondary" size="small">
+ Right
+ </Button>
+ </TooltipTrigger>
+ <TooltipContent side="right">
+ <p>Tooltip on right</p>
+ </TooltipContent>
+ </Tooltip>
+ </TooltipProvider>
+
+ <TooltipProvider>
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <Button variant="secondary" size="small">
+ Bottom
+ </Button>
+ </TooltipTrigger>
+ <TooltipContent side="bottom">
+ <p>Tooltip on bottom</p>
+ </TooltipContent>
+ </Tooltip>
+ </TooltipProvider>
+
+ <TooltipProvider>
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <Button variant="secondary" size="small">
+ Left
+ </Button>
+ </TooltipTrigger>
+ <TooltipContent side="left">
+ <p>Tooltip on left</p>
+ </TooltipContent>
+ </Tooltip>
+ </TooltipProvider>
+ </div>
+ );
+ },
+ parameters: {
+ docs: {
+ description: {
+ story:
+ "Tooltips can be positioned on different sides of the trigger element.",
+ },
+ },
+ },
+};
+
+export const WithIcon: Story = {
+ render: function IconTooltip() {
+ return (
+ <TooltipProvider>
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <button className="rounded-full p-2 hover:bg-gray-100 dark:hover:bg-gray-800">
+ <svg
+ width="16"
+ height="16"
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth="2"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ >
+ <circle cx="12" cy="12" r="10" />
+ <path d="M9,9h0a3,3,0,0,1,6,0c0,2-3,3-3,3" />
+ <path d="m12,17h0" />
+ </svg>
+ </button>
+ </TooltipTrigger>
+ <TooltipContent>
+ <p>Help information</p>
+ </TooltipContent>
+ </Tooltip>
+ </TooltipProvider>
+ );
+ },
+ parameters: {
+ docs: {
+ description: {
+ story: "Tooltip can be used with icon buttons for help or information.",
+ },
+ },
+ },
+};
+
+export const MultipleTooltips: Story = {
+ render: function MultipleTooltips() {
+ return (
+ <TooltipProvider>
+ <div className="flex items-center gap-4">
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <Button variant="secondary" size="small">
+ Save
+ </Button>
+ </TooltipTrigger>
+ <TooltipContent>
+ <p>Save your changes</p>
+ </TooltipContent>
+ </Tooltip>
+
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <Button variant="secondary" size="small">
+ Edit
+ </Button>
+ </TooltipTrigger>
+ <TooltipContent>
+ <p>Edit this item</p>
+ </TooltipContent>
+ </Tooltip>
+
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <Button variant="destructive" size="small">
+ Delete
+ </Button>
+ </TooltipTrigger>
+ <TooltipContent>
+ <p>Delete this item permanently</p>
+ </TooltipContent>
+ </Tooltip>
+ </div>
+ </TooltipProvider>
+ );
+ },
+ parameters: {
+ docs: {
+ description: {
+ story:
+ "Multiple tooltips can share a single TooltipProvider for better performance.",
+ },
+ },
+ },
+};
diff --git a/autogpt_platform/frontend/src/components/contextual/PublishAgentModal/components/AgentInfoStep/AgentInfoStep.tsx b/autogpt_platform/frontend/src/components/contextual/PublishAgentModal/components/AgentInfoStep/AgentInfoStep.tsx
index d7a09390d2..369be98812 100644
--- a/autogpt_platform/frontend/src/components/contextual/PublishAgentModal/components/AgentInfoStep/AgentInfoStep.tsx
+++ b/autogpt_platform/frontend/src/components/contextual/PublishAgentModal/components/AgentInfoStep/AgentInfoStep.tsx
@@ -6,7 +6,7 @@ import { StepHeader } from "../StepHeader";
import { Input } from "@/components/atoms/Input/Input";
import { Select } from "@/components/atoms/Select/Select";
import { Form, FormField } from "@/components/ui/form";
-import { CronExpressionDialog } from "@/components/cron-scheduler-dialog";
+import { CronExpressionDialog } from "@/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/cron-scheduler-dialog";
import { humanizeCronExpression } from "@/lib/cron-expression-utils";
import { CalendarClockIcon } from "lucide-react";
import { Props, useAgentInfoStep } from "./useAgentInfoStep";
diff --git a/autogpt_platform/frontend/src/components/molecules/InformationTooltip/InformationTooltip.stories.tsx b/autogpt_platform/frontend/src/components/molecules/InformationTooltip/InformationTooltip.stories.tsx
new file mode 100644
index 0000000000..cef6a44202
--- /dev/null
+++ b/autogpt_platform/frontend/src/components/molecules/InformationTooltip/InformationTooltip.stories.tsx
@@ -0,0 +1,127 @@
+import type { Meta, StoryObj } from "@storybook/nextjs";
+import { InformationTooltip } from "./InformationTooltip";
+
+const meta: Meta<typeof InformationTooltip> = {
+ title: "Molecules/InformationTooltip",
+ tags: ["autodocs"],
+ component: InformationTooltip,
+ parameters: {
+ layout: "centered",
+ docs: {
+ description: {
+ component:
+ "InformationTooltip component displays contextual help information with markdown support. Shows an info icon that reveals a tooltip on hover with formatted content.",
+ },
+ },
+ },
+ argTypes: {
+ description: {
+ control: "text",
+ description: "Markdown content to display in the tooltip",
+ },
+ },
+ args: {
+ description: "This is helpful information about the feature.",
+ },
+};
+
+export default meta;
+type Story = StoryObj<typeof meta>;
+
+export const Default: Story = {
+ args: {
+ description: "This is helpful information about the feature.",
+ },
+};
+
+export const WithMarkdown: Story = {
+ args: {
+ description: `This tooltip supports **markdown formatting**:
+
+- Bullet points
+- *Italic text*
+- **Bold text**
+
+You can also include [links](https://example.com) that open in new tabs.`,
+ },
+};
+
+export const WithLink: Story = {
+ args: {
+ description:
+ "Visit our [documentation](https://docs.example.com) for more details.",
+ },
+};
+
+export const LongDescription: Story = {
+ args: {
+ description: `This is a longer description that demonstrates how the tooltip handles extended content. The tooltip has a maximum width and will wrap text appropriately to ensure readability while maintaining a clean appearance.
+
+It can include multiple paragraphs and various formatting elements to provide comprehensive help information to users.`,
+ },
+};
+
+export const WithCode: Story = {
+ args: {
+ description:
+ "Use the `API_KEY` environment variable to configure authentication.",
+ },
+};
+
+export const NoDescription: Story = {
+ args: {
+ description: undefined,
+ },
+ parameters: {
+ docs: {
+ description: {
+ story:
+ "When no description is provided, the component returns null and doesn't render anything.",
+ },
+ },
+ },
+};
+
+export const EmptyDescription: Story = {
+ args: {
+ description: "",
+ },
+ parameters: {
+ docs: {
+ description: {
+ story:
+ "When an empty string is provided, the component returns null and doesn't render anything.",
+ },
+ },
+ },
+};
+
+export const MultipleTooltips: Story = {
+ render: renderMultipleTooltips,
+ parameters: {
+ docs: {
+ description: {
+ story: "Multiple tooltips can be used together in a form or interface.",
+ },
+ },
+ },
+};
+
+function renderMultipleTooltips() {
+ return (
+ <div className="flex flex-col gap-4 p-4">
+ <div className="flex items-center gap-2">
+ <span>API Configuration</span>
+ <InformationTooltip description="Configure your API settings here. Make sure to use a valid API key." />
+ </div>
+ <div className="flex items-center gap-2">
+ <span>Webhook URL</span>
+ <InformationTooltip description="The webhook URL where notifications will be sent. Must be a valid HTTPS endpoint." />
+ </div>
+ <div className="flex items-center gap-2">
+ <span>Rate Limiting</span>
+ <InformationTooltip description="Control the number of requests per minute. Higher values may impact performance." />
+ </div>
+ </div>
+ );
+}
diff --git a/autogpt_platform/frontend/src/components/SchemaTooltip.tsx b/autogpt_platform/frontend/src/components/molecules/InformationTooltip/InformationTooltip.tsx
similarity index 59%
rename from autogpt_platform/frontend/src/components/SchemaTooltip.tsx
rename to autogpt_platform/frontend/src/components/molecules/InformationTooltip/InformationTooltip.tsx
index b4010287bc..4bf9a76b94 100644
--- a/autogpt_platform/frontend/src/components/SchemaTooltip.tsx
+++ b/autogpt_platform/frontend/src/components/molecules/InformationTooltip/InformationTooltip.tsx
@@ -3,29 +3,30 @@ import {
TooltipContent,
TooltipProvider,
TooltipTrigger,
-} from "@/components/ui/tooltip";
+} from "@/components/atoms/Tooltip/BaseTooltip";
import { Info } from "lucide-react";
import ReactMarkdown from "react-markdown";
-const SchemaTooltip: React.FC<{ description?: string }> = ({ description }) => {
+type Props = {
+ description?: string;
+};
+
+export function InformationTooltip({ description }: Props) {
if (!description) return null;
return (
<TooltipProvider delayDuration={400}>
<Tooltip>
<TooltipTrigger asChild>
- <Info
- className="rounded-full p-1 hover:bg-gray-300 dark:hover:bg-gray-700"
- size={24}
- />
+ <Info className="rounded-full p-1 hover:bg-slate-50" size={24} />
</TooltipTrigger>
- <TooltipContent className="tooltip-content max-w-xs bg-white text-gray-900 dark:bg-gray-800 dark:text-gray-100">
+ <TooltipContent>
<ReactMarkdown
components={{
a: ({ node: _, ...props }) => (
<a
target="_blank"
- className="text-blue-400 underline dark:text-blue-300"
+ className="text-blue-400 underline"
{...props}
/>
),
@@ -37,6 +38,4 @@ const SchemaTooltip: React.FC<{ description?: string }> = ({ description }) => {
</Tooltip>
</TooltipProvider>
);
-};
-
-export default SchemaTooltip;
+}
diff --git a/autogpt_platform/frontend/src/components/TallyPopup.tsx b/autogpt_platform/frontend/src/components/molecules/TallyPoup/TallyPopup.tsx
similarity index 98%
rename from autogpt_platform/frontend/src/components/TallyPopup.tsx
rename to autogpt_platform/frontend/src/components/molecules/TallyPoup/TallyPopup.tsx
index 9b85b181fc..3ce9cce68c 100644
--- a/autogpt_platform/frontend/src/components/TallyPopup.tsx
+++ b/autogpt_platform/frontend/src/components/molecules/TallyPoup/TallyPopup.tsx
@@ -1,7 +1,7 @@
"use client";
import React, { useEffect, useState } from "react";
-import { Button } from "./ui/button";
+import { Button } from "../../ui/button";
import { QuestionMarkCircledIcon } from "@radix-ui/react-icons";
import { useRouter, usePathname } from "next/navigation";
diff --git a/autogpt_platform/frontend/src/hooks/useAgentGraph.tsx b/autogpt_platform/frontend/src/hooks/useAgentGraph.tsx
index 638226ddd2..cc2e680200 100644
--- a/autogpt_platform/frontend/src/hooks/useAgentGraph.tsx
+++ b/autogpt_platform/frontend/src/hooks/useAgentGraph.tsx
@@ -1,6 +1,5 @@
-import { CustomEdge } from "@/components/CustomEdge";
-import { CustomNode } from "@/components/CustomNode";
-import { useOnboarding } from "@/components/onboarding/onboarding-provider";
+import { CustomEdge } from "@/app/(platform)/build/components/legacy-builder/CustomEdge/CustomEdge";
+import { CustomNode } from "@/app/(platform)/build/components/legacy-builder/CustomNode/CustomNode";
import { useToast } from "@/components/molecules/Toast/use-toast";
import {
ApiError,
@@ -32,6 +31,7 @@ import { default as NextLink } from "next/link";
import { usePathname, useRouter, useSearchParams } from "next/navigation";
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
import { Flag, useGetFlag } from "@/services/feature-flags/use-get-flag";
+import { useOnboarding } from "@/providers/onboarding/onboarding-provider";
export default function useAgentGraph(
flowID?: GraphID,
diff --git a/autogpt_platform/frontend/src/hooks/useCredentials.ts b/autogpt_platform/frontend/src/hooks/useCredentials.ts
index 580dd388e8..eda6ab0278 100644
--- a/autogpt_platform/frontend/src/hooks/useCredentials.ts
+++ b/autogpt_platform/frontend/src/hooks/useCredentials.ts
@@ -4,7 +4,7 @@ import { getValue } from "@/lib/utils";
import {
CredentialsProviderData,
CredentialsProvidersContext,
-} from "@/services/agent-credentials/credentials-provider";
+} from "@/providers/agent-credentials/credentials-provider";
import {
BlockIOCredentialsSubSchema,
CredentialsProviderName,
diff --git a/autogpt_platform/frontend/src/lib/utils.ts b/autogpt_platform/frontend/src/lib/utils.ts
index e273df0629..aaf177156f 100644
--- a/autogpt_platform/frontend/src/lib/utils.ts
+++ b/autogpt_platform/frontend/src/lib/utils.ts
@@ -3,7 +3,7 @@ import { isEmpty as _isEmpty } from "lodash";
import { twMerge } from "tailwind-merge";
import { Category } from "@/lib/autogpt-server-api/types";
-import { NodeDimension } from "@/components/Flow";
+import { NodeDimension } from "@/app/(platform)/build/components/legacy-builder/Flow/Flow";
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
diff --git a/autogpt_platform/frontend/src/services/agent-credentials/credentials-provider.tsx b/autogpt_platform/frontend/src/providers/agent-credentials/credentials-provider.tsx
similarity index 99%
rename from autogpt_platform/frontend/src/services/agent-credentials/credentials-provider.tsx
rename to autogpt_platform/frontend/src/providers/agent-credentials/credentials-provider.tsx
index f4cb1f59ac..bf6b91205d 100644
--- a/autogpt_platform/frontend/src/services/agent-credentials/credentials-provider.tsx
+++ b/autogpt_platform/frontend/src/providers/agent-credentials/credentials-provider.tsx
@@ -11,7 +11,7 @@ import {
} from "@/lib/autogpt-server-api";
import { useBackendAPI } from "@/lib/autogpt-server-api/context";
import { useToastOnFail } from "@/components/molecules/Toast/use-toast";
-import { toDisplayName } from "@/services/agent-credentials/helper";
+import { toDisplayName } from "@/providers/agent-credentials/helper";
type APIKeyCredentialsCreatable = Omit<
APIKeyCredentials,
diff --git a/autogpt_platform/frontend/src/services/agent-credentials/helper.ts b/autogpt_platform/frontend/src/providers/agent-credentials/helper.ts
similarity index 100%
rename from autogpt_platform/frontend/src/services/agent-credentials/helper.ts
rename to autogpt_platform/frontend/src/providers/agent-credentials/helper.ts
diff --git a/autogpt_platform/frontend/src/components/onboarding/onboarding-provider.tsx b/autogpt_platform/frontend/src/providers/onboarding/onboarding-provider.tsx
similarity index 100%
rename from autogpt_platform/frontend/src/components/onboarding/onboarding-provider.tsx
rename to autogpt_platform/frontend/src/providers/onboarding/onboarding-provider.tsx