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.
fix(frontend): Correctly rendering all types of outputs in the custom node in the new builder (#11258)
Abhimanyu Yadave9cd40c0d456
diff --git a/autogpt_platform/frontend/src/app/(platform)/build/components/FlowEditor/nodes/CustomNode/StandardNodeBlock.tsx b/autogpt_platform/frontend/src/app/(platform)/build/components/FlowEditor/nodes/CustomNode/StandardNodeBlock.tsxindex 39b64a6ccd..bec2aee47d 100644--- a/autogpt_platform/frontend/src/app/(platform)/build/components/FlowEditor/nodes/CustomNode/StandardNodeBlock.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/build/components/FlowEditor/nodes/CustomNode/StandardNodeBlock.tsx@@ -10,7 +10,7 @@ import { NodeCost } from "./components/NodeCost";import { NodeBadges } from "./components/NodeBadges";import { NodeExecutionBadge } from "./components/NodeExecutionBadge";import { nodeStyleBasedOnStatus } from "./helpers";-import { NodeDataRenderer } from "./components/NodeDataRenderer";+import { NodeDataRenderer } from "./components/NodeOutput/NodeOutput";type StandardNodeBlockType = {data: CustomNodeData;@@ -30,14 +30,14 @@ export const StandardNodeBlock = ({return (<divclassName={cn(- "z-12 max-w-[370px] rounded-xl shadow-lg shadow-slate-900/5 ring-1 ring-slate-200/60 backdrop-blur-sm",+ "z-12 max-w-[370px] rounded-xlarge shadow-lg shadow-slate-900/5 ring-1 ring-slate-200/60 backdrop-blur-sm",selected && "shadow-2xl ring-2 ring-slate-200",status && nodeStyleBasedOnStatus[status],)}>- <div className="rounded-xl bg-white">+ <div className="rounded-xlarge bg-white">{/* Header */}- <div className="flex h-auto flex-col gap-2 rounded-xl border-b border-slate-200/50 bg-gradient-to-r from-slate-50/80 to-white/90 px-4 py-4">+ <div className="flex h-auto flex-col gap-2 rounded-xlarge border-b border-slate-200/50 bg-gradient-to-r from-slate-50/80 to-white/90 px-4 py-4">{/* Upper section */}<div className="flex items-center gap-2"><Textdiff --git a/autogpt_platform/frontend/src/app/(platform)/build/components/FlowEditor/nodes/CustomNode/components/NodeDataRenderer.tsx b/autogpt_platform/frontend/src/app/(platform)/build/components/FlowEditor/nodes/CustomNode/components/NodeDataRenderer.tsxdeleted file mode 100644index 304d10fd13..0000000000--- a/autogpt_platform/frontend/src/app/(platform)/build/components/FlowEditor/nodes/CustomNode/components/NodeDataRenderer.tsx+++ /dev/null@@ -1,122 +0,0 @@-import { useNodeStore } from "@/app/(platform)/build/stores/nodeStore";-import { Button } from "@/components/atoms/Button/Button";-import { Text } from "@/components/atoms/Text/Text";-import { beautifyString } from "@/lib/utils";-import {- ArrowSquareInIcon,- CaretDownIcon,- CopyIcon,- InfoIcon,-} from "@phosphor-icons/react";-import { useState } from "react";--import { useShallow } from "zustand/react/shallow";--export const NodeDataRenderer = ({ nodeId }: { nodeId: string }) => {- const [isExpanded, setIsExpanded] = useState(true);-- const nodeExecutionResult = useNodeStore(- useShallow((state) => state.getNodeExecutionResult(nodeId)),- );-- const data = {- "[Input]": nodeExecutionResult?.input_data,- ...nodeExecutionResult?.output_data,- };-- // Don't render if there's no data- if (!nodeExecutionResult || Object.keys(data).length === 0) {- return null;- }-- // Need to Fix - when we are on build page and try to rerun the graph again, it gives error-- return (- <div className="flex flex-col gap-3 rounded-b-xl border-t border-slate-200/50 px-4 py-4">- <div className="flex items-center justify-between">- <Text variant="body-medium" className="!font-semibold text-slate-700">- Node Output- </Text>- <Button- variant="ghost"- size="small"- onClick={() => setIsExpanded(!isExpanded)}- className="h-fit min-w-0 p-1 text-slate-600 hover:text-slate-900"- >- <CaretDownIcon- size={16}- weight="bold"- className={`transition-transform ${isExpanded ? "rotate-180" : ""}`}- />- </Button>- </div>-- {isExpanded && (- <>- <div className="flex max-w-[350px] flex-col gap-4">- {Object.entries(data || {}).map(([key, value]) => (- <div key={key} className="flex flex-col gap-2">- <div className="flex items-center gap-2">- <Text- variant="body-medium"- className="!font-semibold text-slate-600"- >- Pin:- </Text>- <Text variant="body" className="text-slate-700">- {beautifyString(key)}- </Text>- </div>- <div className="w-full space-y-2">- <Text- variant="small"- className="!font-semibold text-slate-600"- >- Data:- </Text>- <div className="relative">- <Text- variant="small"- className="rounded-xlarge bg-zinc-50 p-3 text-slate-700"- >- {JSON.stringify(value, null, 2)}- </Text>- <div className="mt-1 flex justify-end gap-1">- {/* TODO: Add tooltip for each button and also make all these blocks working */}- <Button- variant="secondary"- size="small"- className="h-fit min-w-0 gap-1.5 p-2 text-black hover:text-slate-900"- >- <InfoIcon size={16} />- </Button>- <Button- variant="secondary"- size="small"- className="h-fit min-w-0 gap-1.5 p-2 text-black hover:text-slate-900"- >- <ArrowSquareInIcon size={16} />- </Button>- <Button- variant="secondary"- size="small"- className="h-fit min-w-0 gap-1.5 p-2 text-black hover:text-slate-900"- >- <CopyIcon size={16} />- </Button>- </div>- </div>- </div>- </div>- ))}- </div>-- {/* TODO: Currently this button is not working, need to make it working */}- <Button variant="outline" size="small" className="w-fit self-start">- View More- </Button>- </>- )}- </div>- );-};diff --git a/autogpt_platform/frontend/src/app/(platform)/build/components/FlowEditor/nodes/CustomNode/components/NodeOutput/NodeOutput.tsx b/autogpt_platform/frontend/src/app/(platform)/build/components/FlowEditor/nodes/CustomNode/components/NodeOutput/NodeOutput.tsxnew file mode 100644index 0000000000..a4b53e3ac3--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/build/components/FlowEditor/nodes/CustomNode/components/NodeOutput/NodeOutput.tsx@@ -0,0 +1,143 @@+import { Button } from "@/components/atoms/Button/Button";+import { Text } from "@/components/atoms/Text/Text";+import { beautifyString, cn } from "@/lib/utils";+import { CaretDownIcon, CopyIcon, CheckIcon } from "@phosphor-icons/react";+import { NodeDataViewer } from "./components/NodeDataViewer/NodeDataViewer";+import { ContentRenderer } from "./components/ContentRenderer";+import { useNodeOutput } from "./useNodeOutput";+import { ViewMoreData } from "./components/ViewMoreData";++export const NodeDataRenderer = ({ nodeId }: { nodeId: string }) => {+ const {+ outputData,+ isExpanded,+ setIsExpanded,+ copiedKey,+ handleCopy,+ executionResultId,+ inputData,+ } = useNodeOutput(nodeId);++ if (Object.keys(outputData).length === 0) {+ return null;+ }++ return (+ <div className="flex flex-col gap-3 rounded-b-xl border-t border-slate-200/50 px-4 py-4">+ <div className="flex items-center justify-between">+ <Text variant="body-medium" className="!font-semibold text-slate-700">+ Node Output+ </Text>+ <Button+ variant="ghost"+ size="small"+ onClick={() => setIsExpanded(!isExpanded)}+ className="h-fit min-w-0 p-1 text-slate-600 hover:text-slate-900"+ >+ <CaretDownIcon+ size={16}+ weight="bold"+ className={`transition-transform ${isExpanded ? "rotate-180" : ""}`}+ />+ </Button>+ </div>++ {isExpanded && (+ <>+ <div className="flex max-w-[350px] flex-col gap-4">+ <div className="space-y-2">+ <Text variant="small-medium">Input</Text>++ <ContentRenderer value={inputData} shortContent={false} />++ <div className="mt-1 flex justify-end gap-1">+ <NodeDataViewer+ data={inputData}+ pinName="Input"+ execId={executionResultId}+ />+ <Button+ variant="secondary"+ size="small"+ onClick={() => handleCopy("input", inputData)}+ className={cn(+ "h-fit min-w-0 gap-1.5 border border-zinc-200 p-2 text-black hover:text-slate-900",+ copiedKey === "input" &&+ "border-green-400 bg-green-100 hover:border-green-400 hover:bg-green-200",+ )}+ >+ {copiedKey === "input" ? (+ <CheckIcon size={12} className="text-green-600" />+ ) : (+ <CopyIcon size={12} />+ )}+ </Button>+ </div>+ </div>++ {Object.entries(outputData)+ .slice(0, 2)+ .map(([key, value]) => (+ <div key={key} className="flex flex-col gap-2">+ <div className="flex items-center gap-2">+ <Text+ variant="small-medium"+ className="!font-semibold text-slate-600"+ >+ Pin:+ </Text>+ <Text variant="small" className="text-slate-700">+ {beautifyString(key)}+ </Text>+ </div>+ <div className="w-full space-y-2">+ <Text+ variant="small"+ className="!font-semibold text-slate-600"+ >+ Data:+ </Text>+ <div className="relative space-y-2">+ {value.map((item, index) => (+ <div key={index}>+ <ContentRenderer value={item} shortContent={true} />+ </div>+ ))}++ <div className="mt-1 flex justify-end gap-1">+ <NodeDataViewer+ data={value}+ pinName={key}+ execId={executionResultId}+ />+ <Button+ variant="secondary"+ size="small"+ onClick={() => handleCopy(key, value)}+ className={cn(+ "h-fit min-w-0 gap-1.5 border border-zinc-200 p-2 text-black hover:text-slate-900",+ copiedKey === key &&+ "border-green-400 bg-green-100 hover:border-green-400 hover:bg-green-200",+ )}+ >+ {copiedKey === key ? (+ <CheckIcon size={12} className="text-green-600" />+ ) : (+ <CopyIcon size={12} />+ )}+ </Button>+ </div>+ </div>+ </div>+ </div>+ ))}+ </div>++ {Object.keys(outputData).length > 2 && (+ <ViewMoreData outputData={outputData} execId={executionResultId} />+ )}+ </>+ )}+ </div>+ );+};diff --git a/autogpt_platform/frontend/src/app/(platform)/build/components/FlowEditor/nodes/CustomNode/components/NodeOutput/components/ContentRenderer.tsx b/autogpt_platform/frontend/src/app/(platform)/build/components/FlowEditor/nodes/CustomNode/components/NodeOutput/components/ContentRenderer.tsxnew file mode 100644index 0000000000..ed8d4e83de--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/build/components/FlowEditor/nodes/CustomNode/components/NodeOutput/components/ContentRenderer.tsx@@ -0,0 +1,51 @@+"use client";++import { globalRegistry } from "@/app/(platform)/library/agents/[id]/components/AgentRunsView/components/OutputRenderers";+import type { OutputMetadata } from "@/app/(platform)/library/agents/[id]/components/AgentRunsView/components/OutputRenderers";++export const TextRenderer: React.FC<{+ value: any;+ truncateLengthLimit?: number;+}> = ({ value, truncateLengthLimit = 100 }) => {+ const text =+ typeof value === "object" ? JSON.stringify(value, null, 2) : String(value);+ const truncated =+ truncateLengthLimit && text.length > truncateLengthLimit+ ? text.slice(0, truncateLengthLimit) + "..."+ : text;++ return <div className="break-words bg-zinc-50 p-3 text-xs">{truncated}</div>;+};++export const ContentRenderer: React.FC<{+ value: any;+ shortContent?: boolean;+}> = ({ value, shortContent = false }) => {+ const metadata: OutputMetadata = {};++ if (typeof value === "object" && value !== null) {+ if (value.type) metadata.type = value.type;+ if (value.mimeType) metadata.mimeType = value.mimeType;+ if (value.filename) metadata.filename = value.filename;+ }++ const renderer = globalRegistry.getRenderer(value, metadata);++ if (+ renderer?.name === "ImageRenderer" ||+ renderer?.name === "VideoRenderer" ||+ !shortContent+ ) {+ return (+ <div className="[&>*]:rounded-xlarge [&>*]:!text-xs">+ {renderer?.render(value, metadata)}+ </div>+ );+ }++ return (+ <div className="[&>*]:rounded-xlarge [&>*]:!text-xs">+ <TextRenderer value={value} truncateLengthLimit={100} />+ </div>+ );+};diff --git a/autogpt_platform/frontend/src/app/(platform)/build/components/FlowEditor/nodes/CustomNode/components/NodeOutput/components/NodeDataViewer/NodeDataViewer.tsx b/autogpt_platform/frontend/src/app/(platform)/build/components/FlowEditor/nodes/CustomNode/components/NodeOutput/components/NodeDataViewer/NodeDataViewer.tsxnew file mode 100644index 0000000000..90706ccb7e--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/build/components/FlowEditor/nodes/CustomNode/components/NodeOutput/components/NodeDataViewer/NodeDataViewer.tsx@@ -0,0 +1,168 @@+import React, { FC } from "react";+import { Dialog } from "@/components/molecules/Dialog/Dialog";+import { Button } from "@/components/atoms/Button/Button";+import {+ Tooltip,+ TooltipContent,+ TooltipProvider,+ TooltipTrigger,+} from "@/components/atoms/Tooltip/BaseTooltip";+import {+ ArrowsOutSimpleIcon,+ CopyIcon,+ DownloadIcon,+ CheckIcon,+} from "@phosphor-icons/react";+import { Text } from "@/components/atoms/Text/Text";+import { beautifyString } from "@/lib/utils";+import { ScrollArea } from "@/components/__legacy__/ui/scroll-area";+import {+ OutputItem,+ OutputActions,+} from "@/app/(platform)/library/agents/[id]/components/AgentRunsView/components/OutputRenderers";+import { useNodeDataViewer } from "./useNodeDataViewer";++interface NodeDataViewerProps {+ data: any;+ pinName: string;+ execId?: string;+ isViewMoreData?: boolean;+}++export const NodeDataViewer: FC<NodeDataViewerProps> = ({+ data,+ pinName,+ execId = "N/A",+ isViewMoreData = false,+}) => {+ const {+ outputItems,+ copyExecutionId,+ handleCopyItem,+ handleDownloadItem,+ dataArray,+ copiedIndex,+ } = useNodeDataViewer(data, pinName, execId);+ return (+ <Dialog styling={{ width: "600px" }}>+ <TooltipProvider>+ <Tooltip>+ <TooltipTrigger asChild>+ <Dialog.Trigger>+ <Button+ variant="secondary"+ size="small"+ className="h-fit min-w-0 gap-1.5 border border-zinc-200 p-2 text-black hover:text-slate-900"+ >+ <ArrowsOutSimpleIcon size={isViewMoreData ? 16 : 12} />+ </Button>+ </Dialog.Trigger>+ </TooltipTrigger>+ <TooltipContent>+ <p>View Data</p>+ </TooltipContent>+ </Tooltip>+ </TooltipProvider>+ <Dialog.Content>+ <div className="flex flex-col gap-4">+ <div className="flex items-center gap-4">+ <div className="flex items-center gap-2">+ <Text variant="large-medium" className="text-slate-900">+ Full Output Preview+ </Text>+ </div>+ <div className="rounded-full border border-slate-300 bg-slate-100 px-3 py-1.5 text-xs font-medium text-black">+ {dataArray.length} item{dataArray.length !== 1 ? "s" : ""} total+ </div>+ </div>+ <div className="text-sm text-gray-600">+ <div className="flex items-center gap-2">+ <Text variant="body" className="text-slate-600">+ Execution ID:+ </Text>+ <Text+ variant="body-medium"+ className="rounded-full border border-gray-300 bg-gray-50 px-2 py-1 font-mono text-xs"+ >+ {execId}+ </Text>+ <Button+ variant="ghost"+ size="small"+ onClick={copyExecutionId}+ className="h-6 w-6 min-w-0 p-0"+ >+ <CopyIcon size={14} />+ </Button>+ </div>+ <div className="mt-2">+ Pin:{" "}+ <span className="font-semibold">{beautifyString(pinName)}</span>+ </div>+ </div>+ </div>++ <div className="flex-1 overflow-hidden">+ <ScrollArea className="h-full">+ <div className="my-4">+ {dataArray.length > 0 ? (+ <div className="space-y-4">+ {outputItems.map((item, index) => (+ <div key={item.key} className="group relative">+ <OutputItem+ value={item.value}+ metadata={item.metadata}+ renderer={item.renderer}+ />+ <div className="absolute right-3 top-3 flex gap-3">+ <Button+ variant="secondary"+ className="min-w-0 p-1"+ size="icon"+ onClick={() => handleCopyItem(index)}+ aria-label="Copy item"+ >+ {copiedIndex === index ? (+ <CheckIcon className="size-4 text-green-600" />+ ) : (+ <CopyIcon className="size-4 text-black" />+ )}+ </Button>+ <Button+ variant="secondary"+ size="icon"+ className="min-w-0 p-1"+ onClick={() => handleDownloadItem(index)}+ aria-label="Download item"+ >+ <DownloadIcon className="size-4 text-black" />+ </Button>+ </div>+ </div>+ ))}+ </div>+ ) : (+ <div className="py-8 text-center text-gray-500">+ No data available+ </div>+ )}+ </div>+ </ScrollArea>+ </div>++ <div className="flex justify-end pt-4">+ {outputItems.length > 0 && (+ <OutputActions+ items={outputItems.map((item) => ({+ value: item.value,+ metadata: item.metadata,+ renderer: item.renderer,+ }))}+ isPrimary+ />+ )}+ </div>+ </Dialog.Content>+ </Dialog>+ );+};diff --git a/autogpt_platform/frontend/src/app/(platform)/build/components/FlowEditor/nodes/CustomNode/components/NodeOutput/components/NodeDataViewer/useNodeDataViewer.ts b/autogpt_platform/frontend/src/app/(platform)/build/components/FlowEditor/nodes/CustomNode/components/NodeOutput/components/NodeDataViewer/useNodeDataViewer.tsnew file mode 100644index 0000000000..0fb11ae051--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/build/components/FlowEditor/nodes/CustomNode/components/NodeOutput/components/NodeDataViewer/useNodeDataViewer.ts@@ -0,0 +1,133 @@+import React, { useState, useMemo } from "react";+import type { OutputMetadata } from "@/app/(platform)/library/agents/[id]/components/AgentRunsView/components/OutputRenderers";+import { downloadOutputs } from "@/app/(platform)/library/agents/[id]/components/AgentRunsView/components/OutputRenderers/utils/download";+import { useToast } from "@/components/molecules/Toast/use-toast";+import { globalRegistry } from "@/app/(platform)/library/agents/[id]/components/AgentRunsView/components/OutputRenderers";+import { beautifyString } from "@/lib/utils";++export const useNodeDataViewer = (+ data: any,+ pinName: string,+ execId: string,+) => {+ const { toast } = useToast();+ const [copiedIndex, setCopiedIndex] = useState<number | null>(null);++ // Normalize data to array format+ const dataArray = useMemo(() => {+ return Array.isArray(data) ? data : [data];+ }, [data]);++ // Prepare items for the enhanced renderer system+ const outputItems = useMemo(() => {+ if (!dataArray) return [];++ const items: Array<{+ key: string;+ label: string;+ value: unknown;+ metadata?: OutputMetadata;+ renderer: any;+ }> = [];++ dataArray.forEach((value, index) => {+ const metadata: OutputMetadata = {};++ // Extract metadata from the value if it's an object+ if (+ typeof value === "object" &&+ value !== null &&+ !React.isValidElement(value)+ ) {+ const objValue = value as any;+ if (objValue.type) metadata.type = objValue.type;+ if (objValue.mimeType) metadata.mimeType = objValue.mimeType;+ if (objValue.filename) metadata.filename = objValue.filename;+ if (objValue.language) metadata.language = objValue.language;+ }++ const renderer = globalRegistry.getRenderer(value, metadata);+ if (renderer) {+ items.push({+ key: `item-${index}`,+ label: index === 0 ? beautifyString(pinName) : "",+ value,+ metadata,+ renderer,+ });+ } else {+ // Fallback to text renderer+ const textRenderer = globalRegistry+ .getAllRenderers()+ .find((r) => r.name === "TextRenderer");+ if (textRenderer) {+ items.push({+ key: `item-${index}`,+ label: index === 0 ? beautifyString(pinName) : "",+ value:+ typeof value === "string"+ ? value+ : JSON.stringify(value, null, 2),+ metadata,+ renderer: textRenderer,+ });+ }+ }+ });++ return items;+ }, [dataArray, pinName]);++ const copyExecutionId = () => {+ navigator.clipboard.writeText(execId).then(() => {+ toast({+ title: "Execution ID copied to clipboard!",+ duration: 2000,+ });+ });+ };++ const handleCopyItem = async (index: number) => {+ const item = outputItems[index];+ const copyContent = item.renderer.getCopyContent(item.value, item.metadata);++ if (copyContent) {+ try {+ let text: string;+ if (typeof copyContent.data === "string") {+ text = copyContent.data;+ } else if (copyContent.fallbackText) {+ text = copyContent.fallbackText;+ } else {+ return;+ }++ await navigator.clipboard.writeText(text);+ setCopiedIndex(index);+ setTimeout(() => setCopiedIndex(null), 2000);+ } catch (error) {+ console.error("Failed to copy:", error);+ }+ }+ };++ const handleDownloadItem = (index: number) => {+ const item = outputItems[index];+ downloadOutputs([+ {+ value: item.value,+ metadata: item.metadata,+ renderer: item.renderer,+ },+ ]);+ };++ return {+ outputItems,+ dataArray,+ copyExecutionId,+ handleCopyItem,+ handleDownloadItem,+ copiedIndex,+ };+};diff --git a/autogpt_platform/frontend/src/app/(platform)/build/components/FlowEditor/nodes/CustomNode/components/NodeOutput/components/ViewMoreData.tsx b/autogpt_platform/frontend/src/app/(platform)/build/components/FlowEditor/nodes/CustomNode/components/NodeOutput/components/ViewMoreData.tsxnew file mode 100644index 0000000000..7bf026fe43--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/build/components/FlowEditor/nodes/CustomNode/components/NodeOutput/components/ViewMoreData.tsx@@ -0,0 +1,141 @@+import { Dialog } from "@/components/molecules/Dialog/Dialog";+import { Button } from "@/components/atoms/Button/Button";+import { Text } from "@/components/atoms/Text/Text";+import { beautifyString, cn } from "@/lib/utils";+import { ContentRenderer } from "./ContentRenderer";+import { ScrollArea } from "@/components/__legacy__/ui/scroll-area";+import { useState } from "react";+import { NodeDataViewer } from "./NodeDataViewer/NodeDataViewer";+import { useToast } from "@/components/molecules/Toast/use-toast";+import { CheckIcon, CopyIcon } from "@phosphor-icons/react";++export const ViewMoreData = ({+ outputData,+ execId,+}: {+ outputData: Record<string, Array<any>>;+ execId?: string;+}) => {+ const [copiedKey, setCopiedKey] = useState<string | null>(null);+ const { toast } = useToast();++ const handleCopy = (key: string, value: any) => {+ const textToCopy =+ typeof value === "object"+ ? JSON.stringify(value, null, 2)+ : String(value);+ navigator.clipboard.writeText(textToCopy);+ setCopiedKey(key);+ setTimeout(() => setCopiedKey(null), 2000);+ };++ const copyExecutionId = () => {+ navigator.clipboard.writeText(execId || "N/A").then(() => {+ toast({+ title: "Execution ID copied to clipboard!",+ duration: 2000,+ });+ });+ };++ return (+ <Dialog styling={{ width: "600px", paddingRight: "16px" }}>+ <Dialog.Trigger>+ <Button+ variant="primary"+ size="small"+ className="h-fit w-fit min-w-0 !text-xs"+ >+ View More+ </Button>+ </Dialog.Trigger>+ <Dialog.Content>+ <div className="flex flex-col gap-4">+ <Text variant="h4" className="text-slate-900">+ Complete Output Data+ </Text>++ <div className="flex items-center gap-2">+ <Text variant="body" className="text-slate-600">+ Execution ID:+ </Text>+ <Text+ variant="body-medium"+ className="rounded-full border border-gray-300 bg-gray-50 px-2 py-1 font-mono text-xs"+ >+ {execId}+ </Text>+ <Button+ variant="ghost"+ size="small"+ onClick={copyExecutionId}+ className="h-6 w-6 min-w-0 p-0"+ >+ <CopyIcon size={14} />+ </Button>+ </div>++ <ScrollArea className="h-full">+ <div className="flex flex-col gap-4">+ {Object.entries(outputData).map(([key, value]) => (+ <div key={key} className="flex flex-col gap-2">+ <div className="flex items-center gap-2">+ <Text+ variant="body-medium"+ className="!font-semibold text-slate-600"+ >+ Pin:+ </Text>+ <Text variant="body-medium" className="text-slate-700">+ {beautifyString(key)}+ </Text>+ </div>+ <div className="w-full space-y-2">+ <Text+ variant="body-medium"+ className="!font-semibold text-slate-600"+ >+ Data:+ </Text>+ <div className="relative space-y-2">+ {value.map((item, index) => (+ <div key={index}>+ <ContentRenderer value={item} shortContent={false} />+ </div>+ ))}++ <div className="mt-1 flex justify-end gap-1">+ <NodeDataViewer+ data={value}+ pinName={key}+ execId={execId}+ isViewMoreData={true}+ />+ <Button+ variant="secondary"+ size="small"+ onClick={() => handleCopy(key, value)}+ className={cn(+ "h-fit min-w-0 gap-1.5 border border-zinc-200 p-2 text-black hover:text-slate-900",+ copiedKey === key &&+ "border-green-400 bg-green-100 hover:border-green-400 hover:bg-green-200",+ )}+ >+ {copiedKey === key ? (+ <CheckIcon size={16} className="text-green-600" />+ ) : (+ <CopyIcon size={16} />+ )}+ </Button>+ </div>+ </div>+ </div>+ </div>+ ))}+ </div>+ </ScrollArea>+ </div>+ </Dialog.Content>+ </Dialog>+ );+};diff --git a/autogpt_platform/frontend/src/app/(platform)/build/components/FlowEditor/nodes/CustomNode/components/NodeOutput/useNodeOutput.tsx b/autogpt_platform/frontend/src/app/(platform)/build/components/FlowEditor/nodes/CustomNode/components/NodeOutput/useNodeOutput.tsxnew file mode 100644index 0000000000..92661e1484--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/build/components/FlowEditor/nodes/CustomNode/components/NodeOutput/useNodeOutput.tsx@@ -0,0 +1,49 @@+import { useNodeStore } from "@/app/(platform)/build/stores/nodeStore";+import { useToast } from "@/components/molecules/Toast/use-toast";+import { useShallow } from "zustand/react/shallow";+import { useState } from "react";++export const useNodeOutput = (nodeId: string) => {+ const [isExpanded, setIsExpanded] = useState(false);+ const [copiedKey, setCopiedKey] = useState<string | null>(null);+ const { toast } = useToast();++ const nodeExecutionResult = useNodeStore(+ useShallow((state) => state.getNodeExecutionResult(nodeId)),+ );++ const inputData = nodeExecutionResult?.input_data;++ const outputData: Record<string, Array<any>> = {+ ...nodeExecutionResult?.output_data,+ };+ const handleCopy = async (key: string, value: any) => {+ try {+ const text = JSON.stringify(value, null, 2);+ await navigator.clipboard.writeText(text);+ setCopiedKey(key);+ toast({+ title: "Copied to clipboard!",+ duration: 2000,+ });+ setTimeout(() => setCopiedKey(null), 2000);+ } catch (error) {+ console.error("Failed to copy:", error);+ toast({+ title: "Failed to copy",+ variant: "destructive",+ duration: 2000,+ });+ }+ };+ return {+ outputData: outputData,+ inputData: inputData,+ isExpanded: isExpanded,+ setIsExpanded: setIsExpanded,+ copiedKey: copiedKey,+ setCopiedKey: setCopiedKey,+ handleCopy: handleCopy,+ executionResultId: nodeExecutionResult?.node_exec_id,+ };+};diff --git a/autogpt_platform/frontend/src/app/(platform)/build/components/FlowEditor/nodes/OutputHandler.tsx b/autogpt_platform/frontend/src/app/(platform)/build/components/FlowEditor/nodes/OutputHandler.tsxindex 9d99a95812..9c032ac20f 100644--- a/autogpt_platform/frontend/src/app/(platform)/build/components/FlowEditor/nodes/OutputHandler.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/build/components/FlowEditor/nodes/OutputHandler.tsx@@ -27,7 +27,7 @@ export const OutputHandler = ({const [isOutputVisible, setIsOutputVisible] = useState(true);return (- <div className="flex flex-col items-end justify-between gap-2 rounded-b-xl border-t border-slate-200/50 bg-white py-3.5">+ <div className="flex flex-col items-end justify-between gap-2 rounded-b-xlarge border-t border-slate-200/50 bg-white py-3.5"><Buttonvariant="ghost"className="mr-4 h-fit min-w-0 p-0 hover:border-transparent hover:bg-transparent"diff --git a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/AgentRunsView/components/OutputRenderers/components/OutputActions.tsx b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/AgentRunsView/components/OutputRenderers/components/OutputActions.tsxindex 4cbaf669af..cfe69e8709 100644--- a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/AgentRunsView/components/OutputRenderers/components/OutputActions.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/AgentRunsView/components/OutputRenderers/components/OutputActions.tsx@@ -2,9 +2,10 @@import React, { useState } from "react";import { CheckIcon, CopyIcon, DownloadIcon } from "@phosphor-icons/react";-import { Button } from "@/components/__legacy__/ui/button";+import { Button } from "@/components/atoms/Button/Button";import { OutputRenderer, OutputMetadata } from "../types";import { downloadOutputs } from "../utils/download";+import { cn } from "@/lib/utils";interface OutputActionsProps {items: Array<{@@ -12,9 +13,14 @@ interface OutputActionsProps {metadata?: OutputMetadata;renderer: OutputRenderer;}>;+ isPrimary?: boolean;+ className?: string;}-export function OutputActions({ items }: OutputActionsProps) {+export function OutputActions({+ items,+ isPrimary = false,+}: OutputActionsProps) {const [copied, setCopied] = useState(false);const handleCopyAll = async () => {@@ -61,25 +67,39 @@ export function OutputActions({ items }: OutputActionsProps) {return (<div className="flex items-center gap-3"><Button- variant="ghost"- size="icon"+ variant={isPrimary ? "primary" : "ghost"}+ size={isPrimary ? "small" : "icon"}onClick={handleCopyAll}aria-label="Copy all text outputs"+ className={cn(isPrimary ? "min-w-0" : "")}>{copied ? (<CheckIcon className="size-4 text-green-600" />) : (- <CopyIcon className="size-4 text-neutral-500" />+ <CopyIcon+ className={cn(+ "size-4",+ isPrimary ? "text-white" : "text-neutral-500",+ )}+ />)}+ {isPrimary && <span>Copy All</span>}</Button><Button- variant="ghost"- size="icon"+ variant={isPrimary ? "primary" : "ghost"}+ size={isPrimary ? "small" : "icon"}onClick={handleDownloadAll}aria-label="Download outputs"+ className={cn(isPrimary ? "min-w-0" : "")}>- <DownloadIcon className="size-4 text-neutral-500" />+ <DownloadIcon+ className={cn(+ "size-4",+ isPrimary ? "text-white" : "text-neutral-500",+ )}+ />+ {isPrimary && <span>Download All</span>}</Button></div>);diff --git a/autogpt_platform/frontend/src/components/renderers/input-renderer/fields/CredentialField/models/APIKeyCredentialModal/APIKeyCredentialModal.tsx b/autogpt_platform/frontend/src/components/renderers/input-renderer/fields/CredentialField/models/APIKeyCredentialModal/APIKeyCredentialModal.tsxindex 05b2f5b405..47035b4b15 100644--- a/autogpt_platform/frontend/src/components/renderers/input-renderer/fields/CredentialField/models/APIKeyCredentialModal/APIKeyCredentialModal.tsx+++ b/autogpt_platform/frontend/src/components/renderers/input-renderer/fields/CredentialField/models/APIKeyCredentialModal/APIKeyCredentialModal.tsx@@ -114,7 +114,7 @@ export function APIKeyCredentialsModal({ schema, provider }: Props) {onClick={() => setIsOpen(true)}><KeyIcon />- <Text variant="body-medium" className="!text-white opacity-100">+ <Text variant="small" className="!text-white opacity-100">Add API key</Text></Button>diff --git a/autogpt_platform/frontend/src/components/renderers/input-renderer/fields/CredentialField/models/OAuthCredentialModal/OAuthCredentialModal.tsx b/autogpt_platform/frontend/src/components/renderers/input-renderer/fields/CredentialField/models/OAuthCredentialModal/OAuthCredentialModal.tsxindex bc28e333de..fd2810a570 100644--- a/autogpt_platform/frontend/src/components/renderers/input-renderer/fields/CredentialField/models/OAuthCredentialModal/OAuthCredentialModal.tsx+++ b/autogpt_platform/frontend/src/components/renderers/input-renderer/fields/CredentialField/models/OAuthCredentialModal/OAuthCredentialModal.tsx@@ -47,7 +47,9 @@ export const OAuthCredentialModal = ({disabled={loading}>{Icon && <Icon className="size-4" />}- Add OAuth2+ <Text variant="small" className="!text-white opacity-100">+ Add OAuth2+ </Text></Button>{error && (<div className="mt-2 flex w-fit items-center rounded-full bg-red-50 p-1 px-3 ring-1 ring-red-600">diff --git a/autogpt_platform/frontend/src/components/renderers/input-renderer/fields/CredentialField/models/PasswordCredentialModal/PasswordCredentialModal.tsx b/autogpt_platform/frontend/src/components/renderers/input-renderer/fields/CredentialField/models/PasswordCredentialModal/PasswordCredentialModal.tsxindex ca4d853e05..a320b60e96 100644--- a/autogpt_platform/frontend/src/components/renderers/input-renderer/fields/CredentialField/models/PasswordCredentialModal/PasswordCredentialModal.tsx+++ b/autogpt_platform/frontend/src/components/renderers/input-renderer/fields/CredentialField/models/PasswordCredentialModal/PasswordCredentialModal.tsx@@ -5,6 +5,7 @@ import { Form, FormField } from "@/components/__legacy__/ui/form";import { usePasswordCredentialModal } from "./usePasswordCredentialModal";import { toDisplayName } from "../../helpers";import { UserIcon } from "@phosphor-icons/react";+import { Text } from "@/components/atoms/Text/Text";type Props = {provider: string;@@ -92,7 +93,9 @@ export function PasswordCredentialsModal({ provider }: Props) {onClick={() => setOpen(true)}><UserIcon className="size-4" />- Add username & password+ <Text variant="small" className="!text-white opacity-100">+ Add username & password+ </Text></Button></>);diff --git a/autogpt_platform/frontend/src/components/renderers/input-renderer/widgets/ArrayEditorWidget/ArrayEditorWidget.tsx b/autogpt_platform/frontend/src/components/renderers/input-renderer/widgets/ArrayEditorWidget/ArrayEditorWidget.tsxindex 5e00a4be15..4a24709291 100644--- a/autogpt_platform/frontend/src/components/renderers/input-renderer/widgets/ArrayEditorWidget/ArrayEditorWidget.tsx+++ b/autogpt_platform/frontend/src/components/renderers/input-renderer/widgets/ArrayEditorWidget/ArrayEditorWidget.tsx@@ -43,7 +43,7 @@ export const ArrayEditorWidget = ({return (<divkey={element.key}- className="-ml-2 flex max-w-[400px] items-center gap-2"+ className="-ml-2 flex max-w-[350px] items-center gap-2"><ArrayEditorContext.Providervalue={{