diff --git a/app/(playground)/p/[agentId]/beta-proto/feature-flags/types.ts b/app/(playground)/p/[agentId]/beta-proto/feature-flags/types.ts index 0c0578960..aeea5b94d 100644 --- a/app/(playground)/p/[agentId]/beta-proto/feature-flags/types.ts +++ b/app/(playground)/p/[agentId]/beta-proto/feature-flags/types.ts @@ -1,4 +1,5 @@ export interface FeatureFlags { uploadFileToPromptNodeFlag: boolean; webSearchNodeFlag: boolean; + debugFlag: boolean; } diff --git a/app/(playground)/p/[agentId]/beta-proto/giselle-node/components.tsx b/app/(playground)/p/[agentId]/beta-proto/giselle-node/components.tsx index c0632fe9e..10be0a68c 100644 --- a/app/(playground)/p/[agentId]/beta-proto/giselle-node/components.tsx +++ b/app/(playground)/p/[agentId]/beta-proto/giselle-node/components.tsx @@ -26,6 +26,7 @@ type GiselleNodeProps = (GiselleNodeBlueprint | GiselleNodeType) & { resultPortHandle?: FC; incomingConnections?: ConnectorObject[]; outgoingConnections?: ConnectorObject[]; + debug?: boolean; }; type TargetParameterProps = { @@ -203,7 +204,7 @@ export function GiselleNode(props: GiselleNodeProps) { - {props.object === "node" && ( + {props.debug && props.object === "node" && (
Debug info
diff --git a/app/(playground)/p/[agentId]/beta-proto/react-flow-adapter/giselle-node.tsx b/app/(playground)/p/[agentId]/beta-proto/react-flow-adapter/giselle-node.tsx index 2de191ef1..42bfb6369 100644 --- a/app/(playground)/p/[agentId]/beta-proto/react-flow-adapter/giselle-node.tsx +++ b/app/(playground)/p/[agentId]/beta-proto/react-flow-adapter/giselle-node.tsx @@ -14,6 +14,7 @@ import { import clsx from "clsx/lite"; import type { FC } from "react"; import type { ConnectorObject } from "../connector/types"; +import { useFeatureFlags } from "../feature-flags/context"; import { GiselleNode } from "../giselle-node/components"; import { type GiselleNode as GiselleNodeType, @@ -24,6 +25,7 @@ export type ReactFlowNode = Node; export const ReactFlowNode: FC> = ({ data }) => { const edges = useEdges(); + const { debugFlag } = useFeatureFlags(); return ( > = ({ data }) => { .filter((edge) => edge.source === data.id) .map((edge) => edge.data) .filter((connector) => connector != null)} + debug={debugFlag} /> ); }; diff --git a/app/(playground)/p/[agentId]/page.tsx b/app/(playground)/p/[agentId]/page.tsx index 8457ebd28..707fbffd1 100644 --- a/app/(playground)/p/[agentId]/page.tsx +++ b/app/(playground)/p/[agentId]/page.tsx @@ -2,6 +2,7 @@ import "@xyflow/react/dist/style.css"; import { getTeamMembershipByAgentId } from "@/app/(auth)/lib/get-team-membership-by-agent-id"; import { agents, db } from "@/drizzle"; import { + debugFlag as getDebugFlag, uploadFileToPromptNodeFlag as getUploadFileToPromptNodeFlag, webSearchNodeFlag as getWebSearchNodeFlag, } from "@/flags"; @@ -32,6 +33,7 @@ export default async function AgentPlaygroundPage({ const uploadFileToPromptNodeFlag = await getUploadFileToPromptNodeFlag(); const webSearchNodeFlag = await getWebSearchNodeFlag(); + const debugFlag = await getDebugFlag(); const agent = await getAgent(agentId); @@ -39,7 +41,11 @@ export default async function AgentPlaygroundPage({ ); } diff --git a/flags.ts b/flags.ts index 1927a8d4a..cbaf374af 100644 --- a/flags.ts +++ b/flags.ts @@ -41,3 +41,16 @@ export const webSearchNodeFlag = flag({ { value: true, label: "Enable" }, ], }); + +export const debugFlag = flag({ + key: "debug", + async decide() { + return false; + }, + description: "Enable debug mode", + defaultValue: false, + options: [ + { value: false, label: "disable" }, + { value: true, label: "Enable" }, + ], +});