diff --git a/packages/app-shell/src/console/ai/AiChatPage.tsx b/packages/app-shell/src/console/ai/AiChatPage.tsx index 2f6a02288..ef7d0ecca 100644 --- a/packages/app-shell/src/console/ai/AiChatPage.tsx +++ b/packages/app-shell/src/console/ai/AiChatPage.tsx @@ -36,7 +36,7 @@ import { EmptyDescription, cn, } from '@object-ui/components'; -import { PanelLeft, PanelLeftClose, PanelLeftOpen, Share2 } from 'lucide-react'; +import { Bug, PanelLeft, PanelLeftClose, PanelLeftOpen, Share2 } from 'lucide-react'; import { ChatbotEnhanced, useAgents, @@ -76,6 +76,7 @@ import { import { useReconcileOnError } from '../../hooks/useReconcileOnError'; import { ConversationsSidebar } from './ConversationsSidebar'; import { LiveCanvas } from './LiveCanvas'; +import { BuildDebugDrawer } from './BuildDebugDrawer'; const DEFAULT_AI_PATH = '/api/v1/ai'; @@ -633,6 +634,7 @@ export function AiChatPage({ apiBase: apiBaseProp, defaultAgent: defaultAgentPro const [refreshKey, setRefreshKey] = useState(0); const [titleHints, setTitleHints] = useState>({}); const [shareOpen, setShareOpen] = useState(false); + const [debugOpen, setDebugOpen] = useState(false); const [mobileChatsOpen, setMobileChatsOpen] = useState(false); const { collapsed: chatsCollapsed, @@ -833,6 +835,14 @@ export function AiChatPage({ apiBase: apiBaseProp, defaultAgent: defaultAgentPro publicBaseUrl={publicShareBase} /> )} + {conversationId && isBuildAgent(activeAgent) && ( + + )}
{!chatsCollapsed && ( setShareOpen(true)} + onDebug={() => setDebugOpen(true)} + showDebug={isBuildAgent(activeAgent)} onCanvasOpenChange={handleCanvasOpenChange} /> @@ -932,6 +944,10 @@ interface ChatPaneProps { initialMessages: HydratedUIMessage[]; onSent: (firstUserMessage?: string) => void; onShare: () => void; + /** Opens the Build Doctor drawer (build agent only). */ + onDebug?: () => void; + /** Show the Build Doctor button — true only for build-agent conversations. */ + showDebug?: boolean; /** Reports the Live Canvas preview opening/closing so the page can auto-tuck the chats list. */ onCanvasOpenChange?: (open: boolean) => void; } @@ -948,6 +964,8 @@ function ChatPane({ initialMessages, onSent, onShare, + onDebug, + showDebug, onCanvasOpenChange, }: ChatPaneProps) { const { t } = useObjectTranslation(); @@ -1141,6 +1159,20 @@ function ChatPane({ )}
+ {showDebug && onDebug ? ( + + ) : null}