import { useContext, useState } from "react"; import Row from "@moduletrace/twui/layout/Row"; import Stack from "@moduletrace/twui/layout/Stack"; import H1 from "@moduletrace/twui/layout/H1"; import { CpuAi, Layers, Monitor } from "lucide-react"; import type { BUN_SQLITE_COBBLE_WORKSPACES } from "@/db/types/db"; import type { BotWithLastMessage, HarnessOverview } from "@/src/types"; import { BotComputersContext } from "../(data)/bot-computers-context"; import BotComputersModal from "./bot-computers-modal"; import BotModelsModal from "./bot-models-modal"; import BotProfileModal from "./bot-profile-modal"; import BotSessionsModal from "./bot-sessions-modal"; import NewSessionButton from "./new-session-button"; import HeaderMetaItem from "./header-meta-item"; type Props = { bot: BotWithLastMessage; /** * The workspace the conversation is in: its name shows under the * bot's, and the models modal edits its models. */ workspace?: BUN_SQLITE_COBBLE_WORKSPACES | null; has_other_unread?: boolean; /** * The bot's models (the defaults for the coordinator). */ harnesses?: HarnessOverview[] | null; }; /** * 64px header. Under the name, what the bot runs on: its text model and * provider, and the computer it's on. On the right, ghost icon buttons * that open the computers and models modals. Kept here so a save or a * switch shows under the name at once. */ export default function ConversationHeader({ bot, workspace, has_other_unread, harnesses: initial }: Props) { const [harnesses, setHarnesses] = useState(initial); const { computers } = useContext(BotComputersContext); const model = harnesses?.find((h) => h.harness == "text")?.current; const computer = computers[0]; return (

{bot.name}

{workspace?.id ? ( ) : null} {computer?.id ? ( ) : null}
); }