"use client"; import React from "react"; export interface DocumentViewProps { /** Current document text. Grows token-by-token while the agent is streaming. */ content: string; /** True while the agent is actively running. Used to show a live indicator. */ isStreaming: boolean; } /** * Live document panel — renders the `document` slot of agent state. * * On every streamed token, the parent re-renders this component with a * longer `content` string. We surface: * * - a "LIVE" badge + blinking cursor while the agent is running * - the current character count (a cheap but visible token-ish counter) * - the growing document text * * Together they make the per-token delta stream obvious to a viewer. */ export function DocumentView({ content, isStreaming }: DocumentViewProps) { const charCount = content.length; return (
Ask the agent to write something — its output will stream here token by token.
) : (