"use client"; import { DispatchCard } from "@/components/artifacts/dispatch-card"; import { MessageResponse } from "@/components/ai-elements/message"; import type { ArtifactPartProps, ResearchResult } from "@/src/core"; /** * The research tool-call box (contracts.ts "THE ASYNC PROTOCOL" §4). * * The part's output is the fire-and-forget dispatch ACK — the box itself is * the DispatchCard (live status via the central jobs poll; quiet one-liner * once delivered). The research brief itself no longer renders from the * tool part at all: it rides the steer message (the user-role delivery * injected after the wake turn) and renders there via ResearchBriefCard. */ export function JobCard({ part }: ArtifactPartProps) { if (part.state !== "output-available") return null; return ; } /** * The research brief — markdown body + a small source link list. Exported: * the steer card (sub-agent result delivery) renders the same artifact. */ export function ResearchBriefCard({ output }: { output: unknown }) { const result = output as ResearchResult | undefined; if (!result || typeof result.brief !== "string") { return (
Research completed, but the result could not be displayed.
); } const failed = result.brief.startsWith("Research failed"); return (
Research brief {failed && failed}
{result.brief}
{result.sources.length > 0 && (
Sources
)}
); }