diff --git a/app/(playground)/p/[agentId]/canary/contexts/graph.tsx b/app/(playground)/p/[agentId]/canary/contexts/graph.tsx index 89b0f2e9..1c54a391 100644 --- a/app/(playground)/p/[agentId]/canary/contexts/graph.tsx +++ b/app/(playground)/p/[agentId]/canary/contexts/graph.tsx @@ -11,6 +11,7 @@ import { } from "react"; import { deriveFlows } from "../lib/graph"; import type { + AgentId, Artifact, Connection, ConnectionId, @@ -223,6 +224,7 @@ export function GraphContextProvider({ defaultGraph, defaultGraphUrl, onPersistAction, + agentId, }: { children: ReactNode; defaultGraph: Graph; @@ -231,7 +233,8 @@ export function GraphContextProvider({ * Persists the graph to the server. * Returns the new graph URL. */ - onPersistAction: (graph: Graph) => Promise; + onPersistAction: (agentId: AgentId, graph: Graph) => Promise; + agentId: AgentId; }) { const graphRef = useRef(defaultGraph); const [graph, setGraph] = useState(graphRef.current); @@ -241,14 +244,14 @@ export function GraphContextProvider({ const persist = useCallback(async () => { isPendingPersistRef.current = false; try { - const newGraphUrl = await onPersistAction(graphRef.current); + const newGraphUrl = await onPersistAction(agentId, graphRef.current); setGraphUrl(newGraphUrl); return newGraphUrl; } catch (error) { console.error("Failed to persist graph:", error); return graphUrl; } - }, [onPersistAction, graphUrl]); + }, [onPersistAction, graphUrl, agentId]); const flush = useCallback(async () => { if (persistTimeoutRef.current) { diff --git a/app/(playground)/p/[agentId]/canary/page.tsx b/app/(playground)/p/[agentId]/canary/page.tsx index 5220a1f7..83dc8766 100644 --- a/app/(playground)/p/[agentId]/canary/page.tsx +++ b/app/(playground)/p/[agentId]/canary/page.tsx @@ -60,7 +60,7 @@ export default async function Page({ (res) => res.json() as unknown as Graph, ); - async function persistGraph(graph: Graph) { + async function persistGraph(agentId: AgentId, graph: Graph) { "use server"; const { url } = await putGraph(graph); await db @@ -85,7 +85,7 @@ export default async function Page({ let graphUrl = agent.graphUrl; if (!isLatestVersion(graph)) { graph = migrateGraph(graph); - graphUrl = await persistGraph(graph); + graphUrl = await persistGraph(agentId, graph); } async function updateAgentName(agentName: string) { @@ -131,6 +131,7 @@ export default async function Page({ defaultGraph={graph} onPersistAction={persistGraph} defaultGraphUrl={graphUrl} + agentId={agentId} > diff --git a/bun.lockb b/bun.lockb index 73ccbb61..9656492b 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index c2e6c5d7..9db773f9 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "private": true, "scripts": { "predev": "bun prepare-font.js", - "dev": "SENTRY_SUPPRESS_TURBOPACK_WARNING=1 next dev --turbo", + "dev": "SENTRY_SUPPRESS_TURBOPACK_WARNING=1 next dev --turbopack", "dev-debug": "LOGLEVEL=debug bun run dev", "prebuild": "node prepare-font.js", "build": "next build", @@ -20,8 +20,8 @@ "@icons-pack/react-simple-icons": "10.0.0", "@lucide/lab": "0.1.2", "@mendable/firecrawl-js": "1.6.1", - "@next/env": "14.2.5", - "@next/third-parties": "^14.2.13", + "@next/env": "15.1.0", + "@next/third-parties": "15.1.0", "@octokit/auth-app": "7.1.1", "@octokit/core": "6.1.2", "@octokit/request-error": "6.1.5", @@ -76,14 +76,14 @@ "input-otp": "^1.2.4", "langfuse": "3.26.0", "lucide-react": "0.417.0", - "next": "15.0.2", + "next": "15.1.0", "next-auth": "^5.0.0-beta.20", "next-themes": "0.3.0", "openai": "4.64.0", "pino": "9.5.0", "posthog-js": "1.194.2", - "react": "19.0.0-rc-4d577fd2-20241104", - "react-dom": "19.0.0-rc-4d577fd2-20241104", + "react": "19.0.0", + "react-dom": "19.0.0", "remark": "15.0.1", "remark-html": "16.0.1", "stripe": "17.4.0", @@ -102,8 +102,8 @@ "@tailwindcss/typography": "0.5.15", "@types/bun": "1.1.13", "@types/node": "^22", - "@types/react": "npm:types-react@rc", - "@types/react-dom": "npm:types-react-dom@rc", + "@types/react": "19.0.1", + "@types/react-dom": "19.0.2", "drizzle-kit": "0.23.0", "pino-pretty": "13.0.0", "postcss": "^8", @@ -111,9 +111,5 @@ "turbo": "2.0.9", "typescript": "5.6.2" }, - "overrides": { - "@types/react": "npm:types-react@rc", - "@types/react-dom": "npm:types-react-dom@rc" - }, "trustedDependencies": ["@sentry/cli"] }