'use client' import { createContext, useCallback, useContext, useEffect, useMemo, useReducer, useState, } from 'react' import dynamic from 'next/dynamic' import { INITIAL_AGENT_STATUS, reduceAgentStatus, type AgentStatus, type AgentStatusEvent, } from './agent-status' // The sheet is a lazy chunk, and it used to have no loading state at all: a // click on the launcher produced NOTHING until the chunk arrived, then the // whole panel appeared at once. Two fixes: a skeleton in the same geometry so // the surface is there on the first frame, and a prefetch once the page is // idle so the chunk is usually already loaded before anyone clicks. const AgentSheet = dynamic(() => import('./AgentSheet'), { loading: () => , }) function AgentSheetSkeleton() { return (