"use client"; import { CopilotKit } from "@copilotkit/react-core/v2"; import "@copilotkit/react-core/v2/styles.css"; import type { ReactNode } from "react"; /** * The v2 provider must be mounted from a Client Component. It opens the AG-UI * event stream to our runtime route and gives every CopilotKit hook/component * below it access to the agent. */ export function Providers({ children }: { children: ReactNode }) { return ( { // Surfacing errors keeps the chat from getting stuck on "connecting…". console.error("[copilotkit]", event); }} > {children} ); }