import { agentChatRuntimeErrorMessage, type AgentChatRuntime, } from "@agents24/chat-react/runtime" import type { Agents24ChatScaffoldComponents } from "../../app" import type { ThreadMessage } from "@agents24/client" import { AgentChatQueue, queuedMessageComposerFiles, useLiveCompletionRuns, type AgentChatComposerFile } from "@agents24/chat-react/ui" import { CircleAlert, LoaderCircle, SquarePen, X } from "lucide-react" import * as React from "react" import type { Agents24ChatIdentity } from "../../identity" import { ChatComposer } from "./chat-composer" import { ChatMessage } from "./chat-message" import { SubagentTasks } from "./subagent-tasks" import { ThemeMenu } from "./theme-menu" import { ThreadSidebar } from "./thread-sidebar" import { TurnOutline } from "./turn-outline" import { isScaffoldTimelineLoading } from "./timeline-loading" import { Button } from "../ui/button" import { LatestThreadScroller, latestThreadAnchorId, } from "@agents24/chat-react" import { SidebarInset, SidebarProvider, SidebarTrigger, useSidebar } from "../ui/sidebar" const LOADING_INPUT_CONTRACT = { version: "agents24.runtime-inputs.v3" as const, modalities: { text: { enabled: false, required: false }, files: { enabled: false, required: false, allowed_mime_types: [] }, images: { enabled: false, required: false, allowed_mime_types: [] }, audio: { enabled: false, required: false, allowed_mime_types: [], recording_enabled: false }, }, limits: { max_attachments_per_turn: 0, max_file_bytes: 0, max_total_bytes: 0 }, retention: { mode: "thread_lifetime" as const }, } function PersistentSidebarTrigger() { return (
) } function CollapsedHeaderActions({ onNew }: { onNew: () => void }) { const { isMobile, openMobile, state } = useSidebar() const sidebarVisible = isMobile ? openMobile : state === "expanded" if (sidebarVisible) return null return ( <>