@optilogic/chat 1.0.0-beta.1 → 1.0.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/agent-response/components/ActivityIndicators.tsx","../src/components/agent-response/utils.ts","../src/components/agent-response/components/MetadataRow.tsx","../src/components/agent-response/components/ThinkingSection.tsx","../src/components/agent-response/components/ActionBar.tsx","../src/components/agent-response/hooks/useThinkingTimer.ts","../src/components/agent-response/types.ts","../src/components/agent-response/hooks/useAgentResponseAccumulator.ts","../src/components/agent-response/AgentResponse.tsx"],"names":["React","jsxs","cn","Popover","jsx","PopoverTrigger","Wrench","PopoverContent","Book","HardDrive","React2","ChevronUp","ChevronDown","LoadingSpinner","React3","React4","useState","useCallback","Check","Copy","ThumbsUp","ThumbsDown","useEffect","React5","useMemo","Fragment"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,IAAM,kBAAA,GAA2BA,gBAAA,CAAA,UAAA;AAAA,EAC/B,CAAC,EAAE,SAAA,EAAW,SAAA,EAAW,QAAQ,SAAA,EAAW,GAAG,KAAA,EAAM,EAAG,GAAA,KAAQ;AAC9D,IAAA,MAAM,cAAA,GACJ,UAAU,MAAA,GAAS,CAAA,IAAK,UAAU,MAAA,GAAS,CAAA,IAAK,OAAO,MAAA,GAAS,CAAA;AAElE,IAAA,IAAI,CAAC,gBAAgB,OAAO,IAAA;AAE5B,IAAA,uBACEC,eAAA,CAAC,SAAI,GAAA,EAAU,SAAA,EAAWC,QAAG,yBAAA,EAA2B,SAAS,CAAA,EAAI,GAAG,KAAA,EAErE,QAAA,EAAA;AAAA,MAAA,SAAA,CAAU,MAAA,GAAS,CAAA,oBAClBD,eAAA,CAACE,YAAA,EAAA,EACC,QAAA,EAAA;AAAA,wBAAAC,cAAA,CAACC,mBAAA,EAAA,EAAe,SAAO,IAAA,EACrB,QAAA,kBAAAJ,eAAA;AAAA,UAA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component\n *\n * Displays tool, knowledge, memory icons with counts and popovers\n */\n\nimport * as React from \"react\";\nimport { Wrench, Book, HardDrive } from \"lucide-react\";\nimport { cn, Popover, PopoverTrigger, PopoverContent } from \"@optilogic/core\";\nimport type { ToolCall, KnowledgeItem, MemoryItem } from \"../types\";\n\nexport interface ActivityIndicatorsProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Tool calls to display */\n toolCalls: ToolCall[];\n /** Knowledge items to display */\n knowledge: KnowledgeItem[];\n /** Memory items to display */\n memory: MemoryItem[];\n}\n\n/**\n * ActivityIndicators Component\n *\n * Displays icons with counts for tool calls, knowledge retrieval, and memory access.\n * Each icon has a popover showing details when clicked.\n *\n * @example\n * <ActivityIndicators\n * toolCalls={state.toolCalls}\n * knowledge={state.knowledge}\n * memory={state.memory}\n * />\n */\nconst ActivityIndicators = React.forwardRef<HTMLDivElement, ActivityIndicatorsProps>(\n ({ toolCalls, knowledge, memory, className, ...props }, ref) => {\n const hasAnyActivity =\n toolCalls.length > 0 || knowledge.length > 0 || memory.length > 0;\n\n if (!hasAnyActivity) return null;\n\n return (\n <div ref={ref} className={cn(\"flex items-center gap-2\", className)} {...props}>\n {/* Tool Calls */}\n {toolCalls.length > 0 && (\n <Popover>\n <PopoverTrigger asChild>\n <button\n className=\"flex items-center gap-1 text-muted-foreground hover:text-foreground transition-colors\"\n onClick={(e) => e.stopPropagation()}\n >\n <Wrench className=\"w-3.5 h-3.5\" />\n <span className=\"text-xs\">{toolCalls.length}</span>\n </button>\n </PopoverTrigger>\n <PopoverContent className=\"w-80\">\n <div className=\"space-y-2\">\n <h4 className=\"font-medium text-sm\">Tool Calls</h4>\n <div className=\"space-y-2 max-h-60 overflow-auto\">\n {toolCalls.map((tool) => (\n <div key={tool.id} className=\"p-2 bg-muted rounded text-xs\">\n <div className=\"font-medium\">{tool.name}</div>\n {tool.arguments && (\n <pre className=\"mt-1 text-muted-foreground overflow-x-auto\">\n {JSON.stringify(tool.arguments, null, 2)}\n </pre>\n )}\n </div>\n ))}\n </div>\n </div>\n </PopoverContent>\n </Popover>\n )}\n\n {/* Knowledge */}\n {knowledge.length > 0 && (\n <Popover>\n <PopoverTrigger asChild>\n <button\n className=\"flex items-center gap-1 text-muted-foreground hover:text-foreground transition-colors\"\n onClick={(e) => e.stopPropagation()}\n >\n <Book className=\"w-3.5 h-3.5\" />\n <span className=\"text-xs\">{knowledge.length}</span>\n </button>\n </PopoverTrigger>\n <PopoverContent className=\"w-80\">\n <div className=\"space-y-2\">\n <h4 className=\"font-medium text-sm\">Knowledge Retrieved</h4>\n <div className=\"space-y-2 max-h-60 overflow-auto\">\n {knowledge.map((item) => (\n <div key={item.id} className=\"p-2 bg-muted rounded text-xs\">\n <div className=\"font-medium\">{item.source}</div>\n <div className=\"mt-1 text-muted-foreground\">\n {item.content}\n </div>\n </div>\n ))}\n </div>\n </div>\n </PopoverContent>\n </Popover>\n )}\n\n {/* Memory */}\n {memory.length > 0 && (\n <Popover>\n <PopoverTrigger asChild>\n <button\n className=\"flex items-center gap-1 text-muted-foreground hover:text-foreground transition-colors\"\n onClick={(e) => e.stopPropagation()}\n >\n <HardDrive className=\"w-3.5 h-3.5\" />\n <span className=\"text-xs\">{memory.length}</span>\n </button>\n </PopoverTrigger>\n <PopoverContent className=\"w-80\">\n <div className=\"space-y-2\">\n <h4 className=\"font-medium text-sm\">Memory Accessed</h4>\n <div className=\"space-y-2 max-h-60 overflow-auto\">\n {memory.map((item) => (\n <div key={item.id} className=\"p-2 bg-muted rounded text-xs\">\n <div className=\"font-medium\">{item.type}</div>\n <div className=\"mt-1 text-muted-foreground\">\n {item.content}\n </div>\n </div>\n ))}\n </div>\n </div>\n </PopoverContent>\n </Popover>\n )}\n </div>\n );\n }\n);\nActivityIndicators.displayName = \"ActivityIndicators\";\n\nexport { ActivityIndicators };\n","/**\n * Agent Response Utility Functions\n */\n\n/**\n * Format elapsed time for display\n * - Under 60s: \"Xs\" (e.g., \"23s\")\n * - 60+ seconds while active: \"M:SS\" (e.g., \"1:23\")\n * - Complete under 60s: \"Xs\" (e.g., \"45s\")\n * - Complete 60-119s: \"1.X min\" (e.g., \"1.2 min\")\n * - Complete 120+ s: \"X.X min\" (e.g., \"2.5 min\")\n */\nexport function formatTime(seconds: number, isComplete: boolean): string {\n if (seconds < 1) {\n return isComplete ? \"<1s\" : \"0s\";\n }\n\n if (isComplete) {\n // Completed state formatting\n if (seconds < 60) {\n return `${Math.round(seconds)}s`;\n }\n const minutes = seconds / 60;\n return `${minutes.toFixed(1)} min`;\n }\n\n // Active state formatting\n if (seconds < 60) {\n return `${Math.floor(seconds)}s`;\n }\n const mins = Math.floor(seconds / 60);\n const secs = Math.floor(seconds % 60);\n return `${mins}:${secs.toString().padStart(2, \"0\")}`;\n}\n\n/**\n * Format total time for action bar display\n */\nexport function formatTotalTime(seconds: number): string {\n if (seconds < 1) {\n return \"<1s\";\n }\n if (seconds < 60) {\n return `${seconds.toFixed(1)}s`;\n }\n const minutes = seconds / 60;\n return `${minutes.toFixed(1)}m`;\n}\n","/**\n * Metadata Row Component\n *\n * Displays thinking toggle, timer, and activity indicators\n */\n\nimport * as React from \"react\";\nimport { ChevronDown, ChevronUp } from \"lucide-react\";\nimport { cn, LoadingSpinner } from \"@optilogic/core\";\nimport { ActivityIndicators } from \"./ActivityIndicators\";\nimport { formatTime } from \"../utils\";\nimport type { AgentResponseStatus, ToolCall, KnowledgeItem, MemoryItem } from \"../types\";\n\nexport interface MetadataRowProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Whether there is thinking content */\n hasThinking: boolean;\n /** Whether the thinking section is expanded */\n isExpanded: boolean;\n /** Toggle callback for thinking expansion */\n onToggle: () => void;\n /** Tool calls to display */\n toolCalls: ToolCall[];\n /** Knowledge items to display */\n knowledge: KnowledgeItem[];\n /** Memory items to display */\n memory: MemoryItem[];\n /** Current response status */\n status: AgentResponseStatus;\n /** Elapsed time in seconds */\n elapsedTime: number;\n}\n\n/**\n * MetadataRow Component\n *\n * Displays the metadata row with thinking toggle, timer, and activity indicators.\n * When thinking content is present, the row is clickable to toggle expansion.\n *\n * @example\n * <MetadataRow\n * hasThinking={!!state.thinking}\n * isExpanded={thinkingExpanded}\n * onToggle={toggleThinking}\n * toolCalls={state.toolCalls}\n * knowledge={state.knowledge}\n * memory={state.memory}\n * status={state.status}\n * elapsedTime={elapsedTime}\n * />\n */\nconst MetadataRow = React.forwardRef<HTMLDivElement, MetadataRowProps>(\n (\n {\n hasThinking,\n isExpanded,\n onToggle,\n toolCalls,\n knowledge,\n memory,\n status,\n elapsedTime,\n className,\n ...props\n },\n ref\n ) => {\n const isProcessing = status === \"processing\";\n const isComplete = status === \"complete\";\n const hasActivity =\n toolCalls.length > 0 || knowledge.length > 0 || memory.length > 0;\n\n // Determine what to show on the left side\n const renderLeftContent = () => {\n // If we have thinking text, show collapse toggle + label + timer\n if (hasThinking) {\n return (\n <div className=\"flex items-center gap-1.5\">\n {isExpanded ? (\n <ChevronUp className=\"w-3.5 h-3.5 text-muted-foreground\" />\n ) : (\n <ChevronDown className=\"w-3.5 h-3.5 text-muted-foreground\" />\n )}\n <span className=\"text-xs text-muted-foreground\">\n {isComplete\n ? `Thought for ${formatTime(elapsedTime, true)}`\n : `Thinking... ${formatTime(elapsedTime, false)}`}\n </span>\n </div>\n );\n }\n\n // If processing but no thinking text yet, show spinner\n if (isProcessing) {\n return (\n <div className=\"flex items-center gap-1.5\">\n <LoadingSpinner size=\"sm\" variant=\"muted\" className=\"w-3.5 h-3.5\" />\n <span className=\"text-xs text-muted-foreground\">Processing</span>\n </div>\n );\n }\n\n // Complete with no thinking - show nothing on left (just activity on right)\n return null;\n };\n\n const leftContent = renderLeftContent();\n\n // If nothing to show (no thinking, not processing, no activity), hide the row\n if (!leftContent && !hasActivity) {\n return null;\n }\n\n // Always use a div for the row to avoid nesting buttons\n // When there's thinking, only the left side is clickable\n return (\n <div\n ref={ref}\n className={cn(\"w-full flex items-center justify-between px-3 py-2\", className)}\n {...props}\n >\n {/* Left content - clickable when there's thinking */}\n {hasThinking ? (\n <button\n onClick={onToggle}\n className=\"flex items-center gap-1.5 hover:bg-muted/50 -ml-1.5 pl-1.5 pr-2 py-0.5 rounded transition-colors\"\n >\n {leftContent}\n </button>\n ) : (\n <div className=\"flex items-center gap-1.5\">\n {leftContent}\n </div>\n )}\n <ActivityIndicators\n toolCalls={toolCalls}\n knowledge={knowledge}\n memory={memory}\n />\n </div>\n );\n }\n);\nMetadataRow.displayName = \"MetadataRow\";\n\nexport { MetadataRow };\n","/**\n * Thinking Section Component\n *\n * Collapsible section for displaying agent thinking/reasoning content\n */\n\nimport * as React from \"react\";\nimport { cn } from \"@optilogic/core\";\n\nexport interface ThinkingSectionProps extends React.HTMLAttributes<HTMLDivElement> {\n /** The thinking content to display */\n content: string;\n /** Whether the section is expanded */\n isExpanded: boolean;\n}\n\n/**\n * ThinkingSection Component\n *\n * Displays the agent's thinking/reasoning content in a collapsible panel.\n *\n * @example\n * <ThinkingSection content={state.thinking} isExpanded={isExpanded} />\n */\nconst ThinkingSection = React.forwardRef<HTMLDivElement, ThinkingSectionProps>(\n ({ content, isExpanded, className, ...props }, ref) => {\n if (!isExpanded || !content) {\n return null;\n }\n\n return (\n <div\n ref={ref}\n className={cn(\"px-3 pb-3 border-t border-border\", className)}\n {...props}\n >\n <div className=\"mt-2 max-h-[200px] overflow-y-auto\">\n <pre className=\"text-xs text-muted-foreground whitespace-pre-wrap font-mono\">\n {content}\n </pre>\n </div>\n </div>\n );\n }\n);\nThinkingSection.displayName = \"ThinkingSection\";\n\nexport { ThinkingSection };\n","/**\n * Action Bar Component\n *\n * Displays copy, feedback, and timing actions for the response\n */\n\nimport * as React from \"react\";\nimport { useState, useCallback } from \"react\";\nimport { Copy, Check, ThumbsUp, ThumbsDown } from \"lucide-react\";\nimport { cn } from \"@optilogic/core\";\nimport { formatTotalTime } from \"../utils\";\nimport type { FeedbackValue } from \"../types\";\n\nexport interface ActionBarProps extends React.HTMLAttributes<HTMLDivElement> {\n /** The response text (for copying) */\n response: string;\n /** Whether the action bar is visible */\n isVisible: boolean;\n /** Total time in seconds */\n totalTimeSeconds: number;\n /** Current feedback value */\n feedback?: FeedbackValue;\n /** Callback when feedback changes */\n onFeedbackChange?: (feedback: FeedbackValue) => void;\n /** Callback when response is copied */\n onResponseCopy?: (response: string) => void;\n}\n\n/**\n * ActionBar Component\n *\n * Displays action buttons for copying the response, providing feedback,\n * and showing total response time.\n *\n * @example\n * <ActionBar\n * response={state.response}\n * isVisible={isHovered}\n * totalTimeSeconds={totalTime}\n * feedback={feedback}\n * onFeedbackChange={setFeedback}\n * onCopy={handleCopy}\n * />\n */\nconst ActionBar = React.forwardRef<HTMLDivElement, ActionBarProps>(\n (\n {\n response,\n isVisible,\n totalTimeSeconds,\n feedback,\n onFeedbackChange,\n onResponseCopy,\n className,\n ...props\n },\n ref\n ) => {\n const [copied, setCopied] = useState(false);\n\n const handleCopy = useCallback(async () => {\n try {\n await navigator.clipboard.writeText(response);\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n onResponseCopy?.(response);\n } catch (err) {\n console.error(\"Failed to copy response:\", err);\n }\n }, [response, onResponseCopy]);\n\n const handleThumbsUp = useCallback(() => {\n const newValue = feedback === \"up\" ? null : \"up\";\n onFeedbackChange?.(newValue);\n }, [feedback, onFeedbackChange]);\n\n const handleThumbsDown = useCallback(() => {\n const newValue = feedback === \"down\" ? null : \"down\";\n onFeedbackChange?.(newValue);\n }, [feedback, onFeedbackChange]);\n\n const isThumbsUp = feedback === \"up\";\n const isThumbsDown = feedback === \"down\";\n\n return (\n <div\n ref={ref}\n className={cn(\n \"flex items-center justify-between px-4 py-2\",\n \"transition-opacity duration-200\",\n isVisible ? \"opacity-100\" : \"opacity-0 pointer-events-none\",\n className\n )}\n {...props}\n >\n {/* Left side - action buttons */}\n <div className=\"flex items-center gap-1\">\n {/* Copy button */}\n <button\n onClick={handleCopy}\n className=\"p-1.5 rounded hover:bg-muted transition-colors text-muted-foreground hover:text-foreground\"\n title={copied ? \"Copied!\" : \"Copy response\"}\n >\n {copied ? (\n <Check className=\"w-4 h-4 text-green-500\" />\n ) : (\n <Copy className=\"w-4 h-4\" />\n )}\n </button>\n\n {/* Thumbs up */}\n <button\n onClick={handleThumbsUp}\n className={cn(\n \"p-1.5 rounded hover:bg-muted transition-colors\",\n isThumbsUp\n ? \"text-green-500\"\n : \"text-muted-foreground hover:text-foreground\"\n )}\n title=\"Good response\"\n >\n <ThumbsUp className={cn(\"w-4 h-4\", isThumbsUp && \"fill-current\")} />\n </button>\n\n {/* Thumbs down */}\n <button\n onClick={handleThumbsDown}\n className={cn(\n \"p-1.5 rounded hover:bg-muted transition-colors\",\n isThumbsDown\n ? \"text-red-500\"\n : \"text-muted-foreground hover:text-foreground\"\n )}\n title=\"Poor response\"\n >\n <ThumbsDown className={cn(\"w-4 h-4\", isThumbsDown && \"fill-current\")} />\n </button>\n </div>\n\n {/* Right side - timing info */}\n <span className=\"text-xs text-muted-foreground\">\n Total time: {formatTotalTime(totalTimeSeconds)}\n </span>\n </div>\n );\n }\n);\nActionBar.displayName = \"ActionBar\";\n\nexport { ActionBar };\n","/**\n * useThinkingTimer Hook\n *\n * Tracks elapsed time during agent thinking/processing\n */\n\nimport { useState, useEffect } from \"react\";\nimport type { AgentResponseStatus } from \"../types\";\n\nexport interface UseThinkingTimerOptions {\n startTime: number | null;\n endTime: number | null;\n status: AgentResponseStatus;\n}\n\n/**\n * Custom hook for thinking timer\n * Returns elapsed time in seconds\n */\nexport function useThinkingTimer({\n startTime,\n endTime,\n status,\n}: UseThinkingTimerOptions): number {\n const [elapsed, setElapsed] = useState(0);\n\n useEffect(() => {\n if (!startTime) {\n setElapsed(0);\n return;\n }\n\n // If complete, calculate final elapsed time\n if (status === \"complete\" && endTime) {\n setElapsed((endTime - startTime) / 1000);\n return;\n }\n\n // If still processing, update every second\n if (status === \"processing\") {\n const updateElapsed = () => {\n setElapsed((Date.now() - startTime) / 1000);\n };\n\n updateElapsed(); // Initial update\n const interval = setInterval(updateElapsed, 1000);\n return () => clearInterval(interval);\n }\n }, [startTime, endTime, status]);\n\n return elapsed;\n}\n","/**\n * Agent Response Component Types\n *\n * Type definitions for the library-ready agent response component\n */\n\n/**\n * Status of the agent response cycle\n */\nexport type AgentResponseStatus = \"idle\" | \"processing\" | \"complete\";\n\n/**\n * Feedback value for the response\n */\nexport type FeedbackValue = \"up\" | \"down\" | null;\n\n/**\n * Tool call information from the agent\n */\nexport interface ToolCall {\n id: string;\n name: string;\n arguments?: Record<string, unknown>;\n timestamp: number;\n}\n\n/**\n * Knowledge retrieval information\n */\nexport interface KnowledgeItem {\n id: string;\n source: string;\n content: string;\n timestamp: number;\n}\n\n/**\n * Memory access information\n */\nexport interface MemoryItem {\n id: string;\n type: string;\n content: string;\n timestamp: number;\n}\n\n/**\n * State shape for the agent response component\n */\nexport interface AgentResponseState {\n /** Current status of the response cycle */\n status: AgentResponseStatus;\n /** Accumulated thinking/reasoning text */\n thinking: string;\n /** Tool calls made during processing */\n toolCalls: ToolCall[];\n /** Knowledge items retrieved */\n knowledge: KnowledgeItem[];\n /** Memory items accessed */\n memory: MemoryItem[];\n /** Final response text */\n response: string;\n /** Timestamp when first thinking message was received (for timer) */\n thinkingStartTime: number | null;\n /** Timestamp when response was completed (for final timer display) */\n responseCompleteTime: number | null;\n /** Timestamp when first message of any type was received (for total time) */\n firstMessageTime: number | null;\n}\n\n/**\n * WebSocket message payload for agent responses\n */\nexport interface AgentMessage {\n type: \"status\" | \"thinking\" | \"tool_call\" | \"knowledge\" | \"memory\" | \"response\";\n /** Message content - for simple string payloads */\n message?: string;\n /** Alternative content field */\n content?: string;\n /** For status messages */\n status?: string;\n /** For tool_call messages */\n tool?: {\n id: string;\n name: string;\n arguments?: Record<string, unknown>;\n };\n /** For knowledge messages */\n knowledge?: {\n id: string;\n source: string;\n content: string;\n };\n /** For memory messages */\n memory?: {\n id: string;\n type: string;\n content: string;\n };\n}\n\n/**\n * Generic websocket message wrapper type\n */\nexport interface GenericWebSocketMessage {\n topic: string;\n message: AgentMessage;\n accountId?: string;\n}\n\n/**\n * Initial state for the agent response component\n */\nexport const initialAgentResponseState: AgentResponseState = {\n status: \"idle\",\n thinking: \"\",\n toolCalls: [],\n knowledge: [],\n memory: [],\n response: \"\",\n thinkingStartTime: null,\n responseCompleteTime: null,\n firstMessageTime: null,\n};\n","/**\n * useAgentResponseAccumulator Hook\n *\n * Accumulates agent response messages into a unified state\n */\n\nimport { useState, useCallback } from \"react\";\nimport {\n initialAgentResponseState,\n type AgentResponseState,\n type AgentMessage,\n type GenericWebSocketMessage,\n type ToolCall,\n type KnowledgeItem,\n type MemoryItem,\n} from \"../types\";\n\nexport interface UseAgentResponseAccumulatorOptions {\n /** WebSocket topic to filter messages (optional, for convenience) */\n topic?: string;\n}\n\nexport interface UseAgentResponseAccumulatorReturn {\n /** Current accumulated state */\n state: AgentResponseState;\n\n /** Handler to process incoming messages */\n handleMessage: (message: unknown) => void;\n\n /** Reset state to initial */\n reset: () => void;\n}\n\n/**\n * Hook for accumulating agent response messages into a unified state\n *\n * @example\n * const { state, handleMessage, reset } = useAgentResponseAccumulator({ topic: \"agent\" });\n *\n * // In your WebSocket handler:\n * websocket.onmessage = (event) => {\n * handleMessage(JSON.parse(event.data));\n * };\n */\nexport function useAgentResponseAccumulator(\n options?: UseAgentResponseAccumulatorOptions\n): UseAgentResponseAccumulatorReturn {\n const [state, setState] = useState<AgentResponseState>(initialAgentResponseState);\n const topic = options?.topic;\n\n const handleMessage = useCallback(\n (message: unknown) => {\n // If topic filter is provided, check for matching topic\n let payload: AgentMessage;\n\n if (topic) {\n const msg = message as GenericWebSocketMessage;\n if (msg.topic !== topic) return;\n payload = msg.message;\n } else {\n // Assume message is the payload directly\n payload = message as AgentMessage;\n }\n\n setState((prev) => {\n // If we receive a non-status message while idle, transition to processing\n let newStatus = prev.status;\n const isFirstMessage = prev.status === \"idle\" && payload.type !== \"status\";\n if (isFirstMessage) {\n newStatus = \"processing\";\n }\n\n // Track first message time for total time calculation\n const firstMessageTime =\n prev.firstMessageTime ?? (isFirstMessage ? Date.now() : null);\n\n switch (payload.type) {\n case \"status\":\n // \"Harness connected\" resets to idle\n if (\n payload.message === \"Harness connected\" ||\n payload.status === \"Harness connected\"\n ) {\n return { ...initialAgentResponseState };\n }\n return { ...prev, status: newStatus };\n\n case \"thinking\": {\n const newThinking = payload.message || payload.content || \"\";\n // Add line break between thinking messages\n const separator = prev.thinking && newThinking ? \"\\n\\n\" : \"\";\n // Set thinkingStartTime on first thinking message\n const thinkingStartTime =\n prev.thinkingStartTime ?? (newThinking ? Date.now() : null);\n return {\n ...prev,\n status: newStatus,\n thinking: prev.thinking + separator + newThinking,\n thinkingStartTime,\n firstMessageTime,\n };\n }\n\n case \"tool_call\": {\n // Handle both formats: { message: \"ToolName\" } or { tool: { id, name, arguments } }\n const toolName = payload.message || payload.tool?.name;\n if (toolName) {\n const newToolCall: ToolCall = {\n id: payload.tool?.id || `tool-${Date.now()}`,\n name: toolName,\n arguments: payload.tool?.arguments,\n timestamp: Date.now(),\n };\n return {\n ...prev,\n status: newStatus,\n toolCalls: [...prev.toolCalls, newToolCall],\n firstMessageTime,\n };\n }\n return { ...prev, status: newStatus, firstMessageTime };\n }\n\n case \"knowledge\": {\n // Handle both formats: { message: \"content\" } or { knowledge: { id, source, content } }\n const knowledgeContent = payload.message || payload.knowledge?.content;\n if (knowledgeContent) {\n const newKnowledge: KnowledgeItem = {\n id: payload.knowledge?.id || `knowledge-${Date.now()}`,\n source: payload.knowledge?.source || \"unknown\",\n content: knowledgeContent,\n timestamp: Date.now(),\n };\n return {\n ...prev,\n status: newStatus,\n knowledge: [...prev.knowledge, newKnowledge],\n firstMessageTime,\n };\n }\n return { ...prev, status: newStatus, firstMessageTime };\n }\n\n case \"memory\": {\n // Handle both formats: { message: \"content\" } or { memory: { id, type, content } }\n const memoryContent = payload.message || payload.memory?.content;\n if (memoryContent) {\n const newMemory: MemoryItem = {\n id: payload.memory?.id || `memory-${Date.now()}`,\n type: payload.memory?.type || \"unknown\",\n content: memoryContent,\n timestamp: Date.now(),\n };\n return {\n ...prev,\n status: newStatus,\n memory: [...prev.memory, newMemory],\n firstMessageTime,\n };\n }\n return { ...prev, status: newStatus, firstMessageTime };\n }\n\n case \"response\":\n return {\n ...prev,\n status: \"complete\",\n response: payload.message || payload.content || \"\",\n responseCompleteTime: Date.now(),\n firstMessageTime: prev.firstMessageTime ?? Date.now(),\n };\n\n default:\n return { ...prev, status: newStatus, firstMessageTime };\n }\n });\n },\n [topic]\n );\n\n const reset = useCallback(() => {\n setState(initialAgentResponseState);\n }, []);\n\n return { state, handleMessage, reset };\n}\n","/**\n * AgentResponse Component\n *\n * A library-ready presentational component for displaying AI agent responses.\n * Displays thinking, tool calls, knowledge retrieval, memory access, and final response.\n */\n\nimport * as React from \"react\";\nimport { useState, useMemo, useCallback } from \"react\";\nimport { cn } from \"@optilogic/core\";\nimport { MetadataRow, ThinkingSection, ActionBar } from \"./components\";\nimport { useThinkingTimer } from \"./hooks\";\nimport type { AgentResponseState, FeedbackValue } from \"./types\";\n\nexport interface AgentResponseProps extends React.HTMLAttributes<HTMLDivElement> {\n /** The response state to render */\n state: AgentResponseState;\n\n /** Optional unique ID (for list keys) */\n id?: string;\n\n /** Optional timestamp to display */\n timestamp?: Date;\n\n /** Feedback state (controlled) */\n feedback?: FeedbackValue;\n onFeedbackChange?: (feedback: FeedbackValue) => void;\n\n /** Callback when the response is copied via the action bar */\n onResponseCopy?: (response: string) => void;\n\n /** Thinking section expansion (controlled or uncontrolled) */\n defaultThinkingExpanded?: boolean;\n thinkingExpanded?: boolean;\n onThinkingExpandedChange?: (expanded: boolean) => void;\n\n /** Action bar visibility mode */\n actionsVisible?: boolean | \"hover\";\n\n /**\n * Custom markdown renderer for the response content.\n * If not provided, the response will be rendered as plain text.\n *\n * @example\n * <AgentResponse\n * state={state}\n * renderMarkdown={(content) => <MyMarkdownRenderer content={content} />}\n * />\n */\n renderMarkdown?: (content: string) => React.ReactNode;\n}\n\n/**\n * AgentResponse Component\n *\n * A complete component for displaying AI agent responses including:\n * - Thinking/reasoning content (collapsible)\n * - Tool calls, knowledge retrieval, and memory access indicators\n * - Final response with optional markdown rendering\n * - Action bar with copy and feedback buttons\n *\n * @example\n * // Basic usage with useAgentResponseAccumulator hook\n * const { state, handleMessage } = useAgentResponseAccumulator();\n *\n * <AgentResponse state={state} />\n *\n * @example\n * // With markdown rendering and feedback\n * <AgentResponse\n * state={state}\n * renderMarkdown={(content) => <ReactMarkdown>{content}</ReactMarkdown>}\n * feedback={feedback}\n * onFeedbackChange={setFeedback}\n * />\n *\n * @example\n * // Controlled thinking expansion\n * <AgentResponse\n * state={state}\n * thinkingExpanded={isExpanded}\n * onThinkingExpandedChange={setIsExpanded}\n * />\n */\nconst AgentResponse = React.forwardRef<HTMLDivElement, AgentResponseProps>(\n (\n {\n state,\n id,\n timestamp,\n feedback,\n onFeedbackChange,\n onResponseCopy,\n defaultThinkingExpanded = false,\n thinkingExpanded: controlledThinkingExpanded,\n onThinkingExpandedChange,\n actionsVisible = \"hover\",\n renderMarkdown,\n className,\n ...props\n },\n ref\n ) => {\n // Uncontrolled thinking expanded state\n const [uncontrolledExpanded, setUncontrolledExpanded] = useState(defaultThinkingExpanded);\n\n // Determine if thinking is controlled\n const isThinkingControlled = controlledThinkingExpanded !== undefined;\n const thinkingExpanded = isThinkingControlled\n ? controlledThinkingExpanded\n : uncontrolledExpanded;\n\n // Toggle thinking handler\n const toggleThinking = useCallback(() => {\n const newValue = !thinkingExpanded;\n if (isThinkingControlled) {\n onThinkingExpandedChange?.(newValue);\n } else {\n setUncontrolledExpanded(newValue);\n }\n }, [thinkingExpanded, isThinkingControlled, onThinkingExpandedChange]);\n\n // Hover state for action bar visibility\n const [isHovered, setIsHovered] = useState(false);\n\n // Thinking timer\n const elapsedTime = useThinkingTimer({\n startTime: state.thinkingStartTime,\n endTime: state.responseCompleteTime,\n status: state.status,\n });\n\n // Calculate total time (from first message to response complete)\n const totalTimeSeconds = useMemo(() => {\n if (!state.firstMessageTime || !state.responseCompleteTime) return 0;\n return (state.responseCompleteTime - state.firstMessageTime) / 1000;\n }, [state.firstMessageTime, state.responseCompleteTime]);\n\n // Derived state: has any content been received?\n const hasAnyContent =\n state.thinking ||\n state.toolCalls.length > 0 ||\n state.knowledge.length > 0 ||\n state.memory.length > 0 ||\n state.response;\n\n // Derived state: should show metadata row?\n const showMetadataRow =\n state.thinking ||\n state.toolCalls.length > 0 ||\n state.knowledge.length > 0 ||\n state.memory.length > 0 ||\n state.status === \"processing\";\n\n // Determine action bar visibility\n const showActionBar = state.status === \"complete\" && state.response;\n const isActionBarVisible =\n actionsVisible === true ||\n (actionsVisible === \"hover\" && isHovered);\n\n // If no content, render nothing\n if (!hasAnyContent) {\n return null;\n }\n\n return (\n <div\n ref={ref}\n className={className}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n {...props}\n >\n {/* Message Content Container */}\n <div className=\"border border-border rounded-lg overflow-hidden\">\n {/* Metadata Row - show if there's any metadata or thinking */}\n {showMetadataRow && (\n <>\n <MetadataRow\n hasThinking={!!state.thinking}\n isExpanded={thinkingExpanded}\n onToggle={toggleThinking}\n toolCalls={state.toolCalls}\n knowledge={state.knowledge}\n memory={state.memory}\n status={state.status}\n elapsedTime={elapsedTime}\n />\n\n {/* Thinking Content - collapsible with max-height */}\n <ThinkingSection\n content={state.thinking}\n isExpanded={thinkingExpanded}\n />\n </>\n )}\n\n {/* Response Section */}\n {state.response && (\n <div\n className={cn(\n \"bg-muted/50 p-4\",\n showMetadataRow && \"border-t border-border\"\n )}\n >\n {renderMarkdown ? (\n renderMarkdown(state.response)\n ) : (\n <span className=\"whitespace-pre-wrap\">{state.response}</span>\n )}\n </div>\n )}\n </div>\n\n {/* Action Bar - outside the message container, visible on hover when complete */}\n {showActionBar && (\n <ActionBar\n response={state.response}\n isVisible={isActionBarVisible}\n totalTimeSeconds={totalTimeSeconds}\n feedback={feedback}\n onFeedbackChange={onFeedbackChange}\n onResponseCopy={onResponseCopy}\n />\n )}\n </div>\n );\n }\n);\nAgentResponse.displayName = \"AgentResponse\";\n\nexport { AgentResponse };\n"]}
1
+ {"version":3,"sources":["../src/components/agent-response/components/ActivityIndicators.tsx","../src/components/agent-response/utils.ts","../src/components/agent-response/components/MetadataRow.tsx","../src/components/agent-response/components/ThinkingSection.tsx","../src/components/agent-response/components/ActionBar.tsx","../src/components/agent-response/hooks/useThinkingTimer.ts","../src/components/agent-response/types.ts","../src/components/agent-response/hooks/useAgentResponseAccumulator.ts","../src/components/agent-response/AgentResponse.tsx","../src/components/user-prompt/UserPrompt.tsx","../src/components/user-prompt-input/UserPromptInput.tsx"],"names":["React","jsxs","cn","Popover","jsx","PopoverTrigger","Wrench","PopoverContent","Book","HardDrive","React2","ChevronUp","ChevronDown","LoadingSpinner","React3","React4","useState","useCallback","Check","Copy","ThumbsUp","ThumbsDown","useEffect","React5","useMemo","Fragment","React6","Text","React7","SlateEditor","IconButton","Loader2","Send"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,IAAM,kBAAA,GAA2BA,iBAAA,CAAA,UAAA;AAAA,EAC/B,CAAC,EAAE,SAAA,EAAW,SAAA,EAAW,QAAQ,SAAA,EAAW,GAAG,KAAA,EAAM,EAAG,GAAA,KAAQ;AAC9D,IAAA,MAAM,cAAA,GACJ,UAAU,MAAA,GAAS,CAAA,IAAK,UAAU,MAAA,GAAS,CAAA,IAAK,OAAO,MAAA,GAAS,CAAA;AAElE,IAAA,IAAI,CAAC,gBAAgB,OAAO,IAAA;AAE5B,IAAA,uBACEC,eAAA,CAAC,SAAI,GAAA,EAAU,SAAA,EAAWC,QAAG,yBAAA,EAA2B,SAAS,CAAA,EAAI,GAAG,KAAA,EAErE,QAAA,EAAA;AAAA,MAAA,SAAA,CAAU,MAAA,GAAS,CAAA,oBAClBD,eAAA,CAACE,YAAA,EAAA,EACC,QAAA,EAAA;AAAA,wBAAAC,cAAA,C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AAA;AAAA,0BAGA5B,eAAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,uDAAA,EAEb,QAAA,EAAA;AAAA,4BAAAG,cAAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,yBAAA,EAA2B,2BAAgB,EAAE,CAAA;AAAA,4BAG5DA,cAAAA;AAAA,cAAC0B,eAAA;AAAA,cAAA;AAAA,gBACC,IAAA,EACE,YAAA,mBACE1B,cAAAA,CAAC2B,mBAAA,EAAA,EAAQ,WAAU,cAAA,EAAe,CAAA,mBAElC3B,cAAAA,CAAC4B,gBAAA,EAAA,EAAK,CAAA;AAAA,gBAGV,OAAA,EAAQ,QAAA;AAAA,gBACR,IAAA,EAAK,IAAA;AAAA,gBACL,YAAA,EAAY,eAAe,YAAA,GAAe,cAAA;AAAA,gBAC1C,UAAU,CAAC,SAAA;AAAA,gBACX,OAAA,EAAS;AAAA;AAAA;AACX,WAAA,EACF;AAAA;AAAA;AAAA,KACF;AAAA,EAEJ;AACF;AAEA,eAAA,CAAgB,WAAA,GAAc,iBAAA","file":"index.cjs","sourcesContent":["/**\n * Activity Indicators Component\n *\n * Displays tool, knowledge, memory icons with counts and popovers\n */\n\nimport * as React from \"react\";\nimport { Wrench, Book, HardDrive } from \"lucide-react\";\nimport { cn, Popover, PopoverTrigger, PopoverContent } from \"@optilogic/core\";\nimport type { ToolCall, KnowledgeItem, MemoryItem } from \"../types\";\n\nexport interface ActivityIndicatorsProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Tool calls to display */\n toolCalls: ToolCall[];\n /** Knowledge items to display */\n knowledge: KnowledgeItem[];\n /** Memory items to display */\n memory: MemoryItem[];\n}\n\n/**\n * ActivityIndicators Component\n *\n * Displays icons with counts for tool calls, knowledge retrieval, and memory access.\n * Each icon has a popover showing details when clicked.\n *\n * @example\n * <ActivityIndicators\n * toolCalls={state.toolCalls}\n * knowledge={state.knowledge}\n * memory={state.memory}\n * />\n */\nconst ActivityIndicators = React.forwardRef<HTMLDivElement, ActivityIndicatorsProps>(\n ({ toolCalls, knowledge, memory, className, ...props }, ref) => {\n const hasAnyActivity =\n toolCalls.length > 0 || knowledge.length > 0 || memory.length > 0;\n\n if (!hasAnyActivity) return null;\n\n return (\n <div ref={ref} className={cn(\"flex items-center gap-2\", className)} {...props}>\n {/* Tool Calls */}\n {toolCalls.length > 0 && (\n <Popover>\n <PopoverTrigger asChild>\n <button\n className=\"flex items-center gap-1 text-muted-foreground hover:text-foreground transition-colors\"\n onClick={(e) => e.stopPropagation()}\n >\n <Wrench className=\"w-3.5 h-3.5\" />\n <span className=\"text-xs\">{toolCalls.length}</span>\n </button>\n </PopoverTrigger>\n <PopoverContent className=\"w-80\">\n <div className=\"space-y-2\">\n <h4 className=\"font-medium text-sm\">Tool Calls</h4>\n <div className=\"space-y-2 max-h-60 overflow-auto\">\n {toolCalls.map((tool) => (\n <div key={tool.id} className=\"p-2 bg-muted rounded text-xs\">\n <div className=\"font-medium\">{tool.name}</div>\n {tool.arguments && (\n <pre className=\"mt-1 text-muted-foreground overflow-x-auto\">\n {JSON.stringify(tool.arguments, null, 2)}\n </pre>\n )}\n </div>\n ))}\n </div>\n </div>\n </PopoverContent>\n </Popover>\n )}\n\n {/* Knowledge */}\n {knowledge.length > 0 && (\n <Popover>\n <PopoverTrigger asChild>\n <button\n className=\"flex items-center gap-1 text-muted-foreground hover:text-foreground transition-colors\"\n onClick={(e) => e.stopPropagation()}\n >\n <Book className=\"w-3.5 h-3.5\" />\n <span className=\"text-xs\">{knowledge.length}</span>\n </button>\n </PopoverTrigger>\n <PopoverContent className=\"w-80\">\n <div className=\"space-y-2\">\n <h4 className=\"font-medium text-sm\">Knowledge Retrieved</h4>\n <div className=\"space-y-2 max-h-60 overflow-auto\">\n {knowledge.map((item) => (\n <div key={item.id} className=\"p-2 bg-muted rounded text-xs\">\n <div className=\"font-medium\">{item.source}</div>\n <div className=\"mt-1 text-muted-foreground\">\n {item.content}\n </div>\n </div>\n ))}\n </div>\n </div>\n </PopoverContent>\n </Popover>\n )}\n\n {/* Memory */}\n {memory.length > 0 && (\n <Popover>\n <PopoverTrigger asChild>\n <button\n className=\"flex items-center gap-1 text-muted-foreground hover:text-foreground transition-colors\"\n onClick={(e) => e.stopPropagation()}\n >\n <HardDrive className=\"w-3.5 h-3.5\" />\n <span className=\"text-xs\">{memory.length}</span>\n </button>\n </PopoverTrigger>\n <PopoverContent className=\"w-80\">\n <div className=\"space-y-2\">\n <h4 className=\"font-medium text-sm\">Memory Accessed</h4>\n <div className=\"space-y-2 max-h-60 overflow-auto\">\n {memory.map((item) => (\n <div key={item.id} className=\"p-2 bg-muted rounded text-xs\">\n <div className=\"font-medium\">{item.type}</div>\n <div className=\"mt-1 text-muted-foreground\">\n {item.content}\n </div>\n </div>\n ))}\n </div>\n </div>\n </PopoverContent>\n </Popover>\n )}\n </div>\n );\n }\n);\nActivityIndicators.displayName = \"ActivityIndicators\";\n\nexport { ActivityIndicators };\n","/**\n * Agent Response Utility Functions\n */\n\n/**\n * Format elapsed time for display\n * - Under 60s: \"Xs\" (e.g., \"23s\")\n * - 60+ seconds while active: \"M:SS\" (e.g., \"1:23\")\n * - Complete under 60s: \"Xs\" (e.g., \"45s\")\n * - Complete 60-119s: \"1.X min\" (e.g., \"1.2 min\")\n * - Complete 120+ s: \"X.X min\" (e.g., \"2.5 min\")\n */\nexport function formatTime(seconds: number, isComplete: boolean): string {\n if (seconds < 1) {\n return isComplete ? \"<1s\" : \"0s\";\n }\n\n if (isComplete) {\n // Completed state formatting\n if (seconds < 60) {\n return `${Math.round(seconds)}s`;\n }\n const minutes = seconds / 60;\n return `${minutes.toFixed(1)} min`;\n }\n\n // Active state formatting\n if (seconds < 60) {\n return `${Math.floor(seconds)}s`;\n }\n const mins = Math.floor(seconds / 60);\n const secs = Math.floor(seconds % 60);\n return `${mins}:${secs.toString().padStart(2, \"0\")}`;\n}\n\n/**\n * Format total time for action bar display\n */\nexport function formatTotalTime(seconds: number): string {\n if (seconds < 1) {\n return \"<1s\";\n }\n if (seconds < 60) {\n return `${seconds.toFixed(1)}s`;\n }\n const minutes = seconds / 60;\n return `${minutes.toFixed(1)}m`;\n}\n","/**\n * Metadata Row Component\n *\n * Displays thinking toggle, timer, and activity indicators\n */\n\nimport * as React from \"react\";\nimport { ChevronDown, ChevronUp } from \"lucide-react\";\nimport { cn, LoadingSpinner } from \"@optilogic/core\";\nimport { ActivityIndicators } from \"./ActivityIndicators\";\nimport { formatTime } from \"../utils\";\nimport type { AgentResponseStatus, ToolCall, KnowledgeItem, MemoryItem } from \"../types\";\n\nexport interface MetadataRowProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Whether there is thinking content */\n hasThinking: boolean;\n /** Whether the thinking section is expanded */\n isExpanded: boolean;\n /** Toggle callback for thinking expansion */\n onToggle: () => void;\n /** Tool calls to display */\n toolCalls: ToolCall[];\n /** Knowledge items to display */\n knowledge: KnowledgeItem[];\n /** Memory items to display */\n memory: MemoryItem[];\n /** Current response status */\n status: AgentResponseStatus;\n /** Elapsed time in seconds */\n elapsedTime: number;\n}\n\n/**\n * MetadataRow Component\n *\n * Displays the metadata row with thinking toggle, timer, and activity indicators.\n * When thinking content is present, the row is clickable to toggle expansion.\n *\n * @example\n * <MetadataRow\n * hasThinking={!!state.thinking}\n * isExpanded={thinkingExpanded}\n * onToggle={toggleThinking}\n * toolCalls={state.toolCalls}\n * knowledge={state.knowledge}\n * memory={state.memory}\n * status={state.status}\n * elapsedTime={elapsedTime}\n * />\n */\nconst MetadataRow = React.forwardRef<HTMLDivElement, MetadataRowProps>(\n (\n {\n hasThinking,\n isExpanded,\n onToggle,\n toolCalls,\n knowledge,\n memory,\n status,\n elapsedTime,\n className,\n ...props\n },\n ref\n ) => {\n const isProcessing = status === \"processing\";\n const isComplete = status === \"complete\";\n const hasActivity =\n toolCalls.length > 0 || knowledge.length > 0 || memory.length > 0;\n\n // Determine what to show on the left side\n const renderLeftContent = () => {\n // If we have thinking text, show collapse toggle + label + timer\n if (hasThinking) {\n return (\n <div className=\"flex items-center gap-1.5\">\n {isExpanded ? (\n <ChevronUp className=\"w-3.5 h-3.5 text-muted-foreground\" />\n ) : (\n <ChevronDown className=\"w-3.5 h-3.5 text-muted-foreground\" />\n )}\n <span className=\"text-xs text-muted-foreground\">\n {isComplete\n ? `Thought for ${formatTime(elapsedTime, true)}`\n : `Thinking... ${formatTime(elapsedTime, false)}`}\n </span>\n </div>\n );\n }\n\n // If processing but no thinking text yet, show spinner\n if (isProcessing) {\n return (\n <div className=\"flex items-center gap-1.5\">\n <LoadingSpinner size=\"sm\" variant=\"muted\" className=\"w-3.5 h-3.5\" />\n <span className=\"text-xs text-muted-foreground\">Processing</span>\n </div>\n );\n }\n\n // Complete with no thinking - show nothing on left (just activity on right)\n return null;\n };\n\n const leftContent = renderLeftContent();\n\n // If nothing to show (no thinking, not processing, no activity), hide the row\n if (!leftContent && !hasActivity) {\n return null;\n }\n\n // Always use a div for the row to avoid nesting buttons\n // When there's thinking, only the left side is clickable\n return (\n <div\n ref={ref}\n className={cn(\"w-full flex items-center justify-between px-3 py-2\", className)}\n {...props}\n >\n {/* Left content - clickable when there's thinking */}\n {hasThinking ? (\n <button\n onClick={onToggle}\n className=\"flex items-center gap-1.5 hover:bg-muted/50 -ml-1.5 pl-1.5 pr-2 py-0.5 rounded transition-colors\"\n >\n {leftContent}\n </button>\n ) : (\n <div className=\"flex items-center gap-1.5\">\n {leftContent}\n </div>\n )}\n <ActivityIndicators\n toolCalls={toolCalls}\n knowledge={knowledge}\n memory={memory}\n />\n </div>\n );\n }\n);\nMetadataRow.displayName = \"MetadataRow\";\n\nexport { MetadataRow };\n","/**\n * Thinking Section Component\n *\n * Collapsible section for displaying agent thinking/reasoning content\n */\n\nimport * as React from \"react\";\nimport { cn } from \"@optilogic/core\";\n\nexport interface ThinkingSectionProps extends React.HTMLAttributes<HTMLDivElement> {\n /** The thinking content to display */\n content: string;\n /** Whether the section is expanded */\n isExpanded: boolean;\n}\n\n/**\n * ThinkingSection Component\n *\n * Displays the agent's thinking/reasoning content in a collapsible panel.\n *\n * @example\n * <ThinkingSection content={state.thinking} isExpanded={isExpanded} />\n */\nconst ThinkingSection = React.forwardRef<HTMLDivElement, ThinkingSectionProps>(\n ({ content, isExpanded, className, ...props }, ref) => {\n if (!isExpanded || !content) {\n return null;\n }\n\n return (\n <div\n ref={ref}\n className={cn(\"px-3 pb-3 border-t border-border\", className)}\n {...props}\n >\n <div className=\"mt-2 max-h-[200px] overflow-y-auto\">\n <pre className=\"text-xs text-muted-foreground whitespace-pre-wrap font-mono\">\n {content}\n </pre>\n </div>\n </div>\n );\n }\n);\nThinkingSection.displayName = \"ThinkingSection\";\n\nexport { ThinkingSection };\n","/**\n * Action Bar Component\n *\n * Displays copy, feedback, and timing actions for the response\n */\n\nimport * as React from \"react\";\nimport { useState, useCallback } from \"react\";\nimport { Copy, Check, ThumbsUp, ThumbsDown } from \"lucide-react\";\nimport { cn } from \"@optilogic/core\";\nimport { formatTotalTime } from \"../utils\";\nimport type { FeedbackValue } from \"../types\";\n\nexport interface ActionBarProps extends React.HTMLAttributes<HTMLDivElement> {\n /** The response text (for copying) */\n response: string;\n /** Whether the action bar is visible */\n isVisible: boolean;\n /** Total time in seconds */\n totalTimeSeconds: number;\n /** Current feedback value */\n feedback?: FeedbackValue;\n /** Callback when feedback changes */\n onFeedbackChange?: (feedback: FeedbackValue) => void;\n /** Callback when response is copied */\n onResponseCopy?: (response: string) => void;\n}\n\n/**\n * ActionBar Component\n *\n * Displays action buttons for copying the response, providing feedback,\n * and showing total response time.\n *\n * @example\n * <ActionBar\n * response={state.response}\n * isVisible={isHovered}\n * totalTimeSeconds={totalTime}\n * feedback={feedback}\n * onFeedbackChange={setFeedback}\n * onCopy={handleCopy}\n * />\n */\nconst ActionBar = React.forwardRef<HTMLDivElement, ActionBarProps>(\n (\n {\n response,\n isVisible,\n totalTimeSeconds,\n feedback,\n onFeedbackChange,\n onResponseCopy,\n className,\n ...props\n },\n ref\n ) => {\n const [copied, setCopied] = useState(false);\n\n const handleCopy = useCallback(async () => {\n try {\n await navigator.clipboard.writeText(response);\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n onResponseCopy?.(response);\n } catch (err) {\n console.error(\"Failed to copy response:\", err);\n }\n }, [response, onResponseCopy]);\n\n const handleThumbsUp = useCallback(() => {\n const newValue = feedback === \"up\" ? null : \"up\";\n onFeedbackChange?.(newValue);\n }, [feedback, onFeedbackChange]);\n\n const handleThumbsDown = useCallback(() => {\n const newValue = feedback === \"down\" ? null : \"down\";\n onFeedbackChange?.(newValue);\n }, [feedback, onFeedbackChange]);\n\n const isThumbsUp = feedback === \"up\";\n const isThumbsDown = feedback === \"down\";\n\n return (\n <div\n ref={ref}\n className={cn(\n \"flex items-center justify-between px-4 py-2\",\n \"transition-opacity duration-200\",\n isVisible ? \"opacity-100\" : \"opacity-0 pointer-events-none\",\n className\n )}\n {...props}\n >\n {/* Left side - action buttons */}\n <div className=\"flex items-center gap-1\">\n {/* Copy button */}\n <button\n onClick={handleCopy}\n className=\"p-1.5 rounded hover:bg-muted transition-colors text-muted-foreground hover:text-foreground\"\n title={copied ? \"Copied!\" : \"Copy response\"}\n >\n {copied ? (\n <Check className=\"w-4 h-4 text-green-500\" />\n ) : (\n <Copy className=\"w-4 h-4\" />\n )}\n </button>\n\n {/* Thumbs up */}\n <button\n onClick={handleThumbsUp}\n className={cn(\n \"p-1.5 rounded hover:bg-muted transition-colors\",\n isThumbsUp\n ? \"text-green-500\"\n : \"text-muted-foreground hover:text-foreground\"\n )}\n title=\"Good response\"\n >\n <ThumbsUp className={cn(\"w-4 h-4\", isThumbsUp && \"fill-current\")} />\n </button>\n\n {/* Thumbs down */}\n <button\n onClick={handleThumbsDown}\n className={cn(\n \"p-1.5 rounded hover:bg-muted transition-colors\",\n isThumbsDown\n ? \"text-red-500\"\n : \"text-muted-foreground hover:text-foreground\"\n )}\n title=\"Poor response\"\n >\n <ThumbsDown className={cn(\"w-4 h-4\", isThumbsDown && \"fill-current\")} />\n </button>\n </div>\n\n {/* Right side - timing info */}\n <span className=\"text-xs text-muted-foreground\">\n Total time: {formatTotalTime(totalTimeSeconds)}\n </span>\n </div>\n );\n }\n);\nActionBar.displayName = \"ActionBar\";\n\nexport { ActionBar };\n","/**\n * useThinkingTimer Hook\n *\n * Tracks elapsed time during agent thinking/processing\n */\n\nimport { useState, useEffect } from \"react\";\nimport type { AgentResponseStatus } from \"../types\";\n\nexport interface UseThinkingTimerOptions {\n startTime: number | null;\n endTime: number | null;\n status: AgentResponseStatus;\n}\n\n/**\n * Custom hook for thinking timer\n * Returns elapsed time in seconds\n */\nexport function useThinkingTimer({\n startTime,\n endTime,\n status,\n}: UseThinkingTimerOptions): number {\n const [elapsed, setElapsed] = useState(0);\n\n useEffect(() => {\n if (!startTime) {\n setElapsed(0);\n return;\n }\n\n // If complete, calculate final elapsed time\n if (status === \"complete\" && endTime) {\n setElapsed((endTime - startTime) / 1000);\n return;\n }\n\n // If still processing, update every second\n if (status === \"processing\") {\n const updateElapsed = () => {\n setElapsed((Date.now() - startTime) / 1000);\n };\n\n updateElapsed(); // Initial update\n const interval = setInterval(updateElapsed, 1000);\n return () => clearInterval(interval);\n }\n }, [startTime, endTime, status]);\n\n return elapsed;\n}\n","/**\n * Agent Response Component Types\n *\n * Type definitions for the library-ready agent response component\n */\n\n/**\n * Status of the agent response cycle\n */\nexport type AgentResponseStatus = \"idle\" | \"processing\" | \"complete\";\n\n/**\n * Feedback value for the response\n */\nexport type FeedbackValue = \"up\" | \"down\" | null;\n\n/**\n * Tool call information from the agent\n */\nexport interface ToolCall {\n id: string;\n name: string;\n arguments?: Record<string, unknown>;\n timestamp: number;\n}\n\n/**\n * Knowledge retrieval information\n */\nexport interface KnowledgeItem {\n id: string;\n source: string;\n content: string;\n timestamp: number;\n}\n\n/**\n * Memory access information\n */\nexport interface MemoryItem {\n id: string;\n type: string;\n content: string;\n timestamp: number;\n}\n\n/**\n * State shape for the agent response component\n */\nexport interface AgentResponseState {\n /** Current status of the response cycle */\n status: AgentResponseStatus;\n /** Accumulated thinking/reasoning text */\n thinking: string;\n /** Tool calls made during processing */\n toolCalls: ToolCall[];\n /** Knowledge items retrieved */\n knowledge: KnowledgeItem[];\n /** Memory items accessed */\n memory: MemoryItem[];\n /** Final response text */\n response: string;\n /** Timestamp when first thinking message was received (for timer) */\n thinkingStartTime: number | null;\n /** Timestamp when response was completed (for final timer display) */\n responseCompleteTime: number | null;\n /** Timestamp when first message of any type was received (for total time) */\n firstMessageTime: number | null;\n}\n\n/**\n * WebSocket message payload for agent responses\n */\nexport interface AgentMessage {\n type: \"status\" | \"thinking\" | \"tool_call\" | \"knowledge\" | \"memory\" | \"response\";\n /** Message content - for simple string payloads */\n message?: string;\n /** Alternative content field */\n content?: string;\n /** For status messages */\n status?: string;\n /** For tool_call messages */\n tool?: {\n id: string;\n name: string;\n arguments?: Record<string, unknown>;\n };\n /** For knowledge messages */\n knowledge?: {\n id: string;\n source: string;\n content: string;\n };\n /** For memory messages */\n memory?: {\n id: string;\n type: string;\n content: string;\n };\n}\n\n/**\n * Generic websocket message wrapper type\n */\nexport interface GenericWebSocketMessage {\n topic: string;\n message: AgentMessage;\n accountId?: string;\n}\n\n/**\n * Initial state for the agent response component\n */\nexport const initialAgentResponseState: AgentResponseState = {\n status: \"idle\",\n thinking: \"\",\n toolCalls: [],\n knowledge: [],\n memory: [],\n response: \"\",\n thinkingStartTime: null,\n responseCompleteTime: null,\n firstMessageTime: null,\n};\n","/**\n * useAgentResponseAccumulator Hook\n *\n * Accumulates agent response messages into a unified state\n */\n\nimport { useState, useCallback } from \"react\";\nimport {\n initialAgentResponseState,\n type AgentResponseState,\n type AgentMessage,\n type GenericWebSocketMessage,\n type ToolCall,\n type KnowledgeItem,\n type MemoryItem,\n} from \"../types\";\n\nexport interface UseAgentResponseAccumulatorOptions {\n /** WebSocket topic to filter messages (optional, for convenience) */\n topic?: string;\n}\n\nexport interface UseAgentResponseAccumulatorReturn {\n /** Current accumulated state */\n state: AgentResponseState;\n\n /** Handler to process incoming messages */\n handleMessage: (message: unknown) => void;\n\n /** Reset state to initial */\n reset: () => void;\n}\n\n/**\n * Hook for accumulating agent response messages into a unified state\n *\n * @example\n * const { state, handleMessage, reset } = useAgentResponseAccumulator({ topic: \"agent\" });\n *\n * // In your WebSocket handler:\n * websocket.onmessage = (event) => {\n * handleMessage(JSON.parse(event.data));\n * };\n */\nexport function useAgentResponseAccumulator(\n options?: UseAgentResponseAccumulatorOptions\n): UseAgentResponseAccumulatorReturn {\n const [state, setState] = useState<AgentResponseState>(initialAgentResponseState);\n const topic = options?.topic;\n\n const handleMessage = useCallback(\n (message: unknown) => {\n // If topic filter is provided, check for matching topic\n let payload: AgentMessage;\n\n if (topic) {\n const msg = message as GenericWebSocketMessage;\n if (msg.topic !== topic) return;\n payload = msg.message;\n } else {\n // Assume message is the payload directly\n payload = message as AgentMessage;\n }\n\n setState((prev) => {\n // If we receive a non-status message while idle, transition to processing\n let newStatus = prev.status;\n const isFirstMessage = prev.status === \"idle\" && payload.type !== \"status\";\n if (isFirstMessage) {\n newStatus = \"processing\";\n }\n\n // Track first message time for total time calculation\n const firstMessageTime =\n prev.firstMessageTime ?? (isFirstMessage ? Date.now() : null);\n\n switch (payload.type) {\n case \"status\":\n // \"Harness connected\" resets to idle\n if (\n payload.message === \"Harness connected\" ||\n payload.status === \"Harness connected\"\n ) {\n return { ...initialAgentResponseState };\n }\n return { ...prev, status: newStatus };\n\n case \"thinking\": {\n const newThinking = payload.message || payload.content || \"\";\n // Add line break between thinking messages\n const separator = prev.thinking && newThinking ? \"\\n\\n\" : \"\";\n // Set thinkingStartTime on first thinking message\n const thinkingStartTime =\n prev.thinkingStartTime ?? (newThinking ? Date.now() : null);\n return {\n ...prev,\n status: newStatus,\n thinking: prev.thinking + separator + newThinking,\n thinkingStartTime,\n firstMessageTime,\n };\n }\n\n case \"tool_call\": {\n // Handle both formats: { message: \"ToolName\" } or { tool: { id, name, arguments } }\n const toolName = payload.message || payload.tool?.name;\n if (toolName) {\n const newToolCall: ToolCall = {\n id: payload.tool?.id || `tool-${Date.now()}`,\n name: toolName,\n arguments: payload.tool?.arguments,\n timestamp: Date.now(),\n };\n return {\n ...prev,\n status: newStatus,\n toolCalls: [...prev.toolCalls, newToolCall],\n firstMessageTime,\n };\n }\n return { ...prev, status: newStatus, firstMessageTime };\n }\n\n case \"knowledge\": {\n // Handle both formats: { message: \"content\" } or { knowledge: { id, source, content } }\n const knowledgeContent = payload.message || payload.knowledge?.content;\n if (knowledgeContent) {\n const newKnowledge: KnowledgeItem = {\n id: payload.knowledge?.id || `knowledge-${Date.now()}`,\n source: payload.knowledge?.source || \"unknown\",\n content: knowledgeContent,\n timestamp: Date.now(),\n };\n return {\n ...prev,\n status: newStatus,\n knowledge: [...prev.knowledge, newKnowledge],\n firstMessageTime,\n };\n }\n return { ...prev, status: newStatus, firstMessageTime };\n }\n\n case \"memory\": {\n // Handle both formats: { message: \"content\" } or { memory: { id, type, content } }\n const memoryContent = payload.message || payload.memory?.content;\n if (memoryContent) {\n const newMemory: MemoryItem = {\n id: payload.memory?.id || `memory-${Date.now()}`,\n type: payload.memory?.type || \"unknown\",\n content: memoryContent,\n timestamp: Date.now(),\n };\n return {\n ...prev,\n status: newStatus,\n memory: [...prev.memory, newMemory],\n firstMessageTime,\n };\n }\n return { ...prev, status: newStatus, firstMessageTime };\n }\n\n case \"response\":\n return {\n ...prev,\n status: \"complete\",\n response: payload.message || payload.content || \"\",\n responseCompleteTime: Date.now(),\n firstMessageTime: prev.firstMessageTime ?? Date.now(),\n };\n\n default:\n return { ...prev, status: newStatus, firstMessageTime };\n }\n });\n },\n [topic]\n );\n\n const reset = useCallback(() => {\n setState(initialAgentResponseState);\n }, []);\n\n return { state, handleMessage, reset };\n}\n","/**\n * AgentResponse Component\n *\n * A library-ready presentational component for displaying AI agent responses.\n * Displays thinking, tool calls, knowledge retrieval, memory access, and final response.\n */\n\nimport * as React from \"react\";\nimport { useState, useMemo, useCallback } from \"react\";\nimport { cn } from \"@optilogic/core\";\nimport { MetadataRow, ThinkingSection, ActionBar } from \"./components\";\nimport { useThinkingTimer } from \"./hooks\";\nimport type { AgentResponseState, FeedbackValue } from \"./types\";\n\nexport interface AgentResponseProps extends React.HTMLAttributes<HTMLDivElement> {\n /** The response state to render */\n state: AgentResponseState;\n\n /** Optional unique ID (for list keys) */\n id?: string;\n\n /** Optional timestamp to display */\n timestamp?: Date;\n\n /** Feedback state (controlled) */\n feedback?: FeedbackValue;\n onFeedbackChange?: (feedback: FeedbackValue) => void;\n\n /** Callback when the response is copied via the action bar */\n onResponseCopy?: (response: string) => void;\n\n /** Thinking section expansion (controlled or uncontrolled) */\n defaultThinkingExpanded?: boolean;\n thinkingExpanded?: boolean;\n onThinkingExpandedChange?: (expanded: boolean) => void;\n\n /** Action bar visibility mode */\n actionsVisible?: boolean | \"hover\";\n\n /**\n * Custom markdown renderer for the response content.\n * If not provided, the response will be rendered as plain text.\n *\n * @example\n * <AgentResponse\n * state={state}\n * renderMarkdown={(content) => <MyMarkdownRenderer content={content} />}\n * />\n */\n renderMarkdown?: (content: string) => React.ReactNode;\n}\n\n/**\n * AgentResponse Component\n *\n * A complete component for displaying AI agent responses including:\n * - Thinking/reasoning content (collapsible)\n * - Tool calls, knowledge retrieval, and memory access indicators\n * - Final response with optional markdown rendering\n * - Action bar with copy and feedback buttons\n *\n * @example\n * // Basic usage with useAgentResponseAccumulator hook\n * const { state, handleMessage } = useAgentResponseAccumulator();\n *\n * <AgentResponse state={state} />\n *\n * @example\n * // With markdown rendering and feedback\n * <AgentResponse\n * state={state}\n * renderMarkdown={(content) => <ReactMarkdown>{content}</ReactMarkdown>}\n * feedback={feedback}\n * onFeedbackChange={setFeedback}\n * />\n *\n * @example\n * // Controlled thinking expansion\n * <AgentResponse\n * state={state}\n * thinkingExpanded={isExpanded}\n * onThinkingExpandedChange={setIsExpanded}\n * />\n */\nconst AgentResponse = React.forwardRef<HTMLDivElement, AgentResponseProps>(\n (\n {\n state,\n id,\n timestamp,\n feedback,\n onFeedbackChange,\n onResponseCopy,\n defaultThinkingExpanded = false,\n thinkingExpanded: controlledThinkingExpanded,\n onThinkingExpandedChange,\n actionsVisible = \"hover\",\n renderMarkdown,\n className,\n ...props\n },\n ref\n ) => {\n // Uncontrolled thinking expanded state\n const [uncontrolledExpanded, setUncontrolledExpanded] = useState(defaultThinkingExpanded);\n\n // Determine if thinking is controlled\n const isThinkingControlled = controlledThinkingExpanded !== undefined;\n const thinkingExpanded = isThinkingControlled\n ? controlledThinkingExpanded\n : uncontrolledExpanded;\n\n // Toggle thinking handler\n const toggleThinking = useCallback(() => {\n const newValue = !thinkingExpanded;\n if (isThinkingControlled) {\n onThinkingExpandedChange?.(newValue);\n } else {\n setUncontrolledExpanded(newValue);\n }\n }, [thinkingExpanded, isThinkingControlled, onThinkingExpandedChange]);\n\n // Hover state for action bar visibility\n const [isHovered, setIsHovered] = useState(false);\n\n // Thinking timer\n const elapsedTime = useThinkingTimer({\n startTime: state.thinkingStartTime,\n endTime: state.responseCompleteTime,\n status: state.status,\n });\n\n // Calculate total time (from first message to response complete)\n const totalTimeSeconds = useMemo(() => {\n if (!state.firstMessageTime || !state.responseCompleteTime) return 0;\n return (state.responseCompleteTime - state.firstMessageTime) / 1000;\n }, [state.firstMessageTime, state.responseCompleteTime]);\n\n // Derived state: has any content been received?\n const hasAnyContent =\n state.thinking ||\n state.toolCalls.length > 0 ||\n state.knowledge.length > 0 ||\n state.memory.length > 0 ||\n state.response;\n\n // Derived state: should show metadata row?\n const showMetadataRow =\n state.thinking ||\n state.toolCalls.length > 0 ||\n state.knowledge.length > 0 ||\n state.memory.length > 0 ||\n state.status === \"processing\";\n\n // Determine action bar visibility\n const showActionBar = state.status === \"complete\" && state.response;\n const isActionBarVisible =\n actionsVisible === true ||\n (actionsVisible === \"hover\" && isHovered);\n\n // If no content, render nothing\n if (!hasAnyContent) {\n return null;\n }\n\n return (\n <div\n ref={ref}\n className={className}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n {...props}\n >\n {/* Message Content Container */}\n <div className=\"border border-border rounded-lg overflow-hidden\">\n {/* Metadata Row - show if there's any metadata or thinking */}\n {showMetadataRow && (\n <>\n <MetadataRow\n hasThinking={!!state.thinking}\n isExpanded={thinkingExpanded}\n onToggle={toggleThinking}\n toolCalls={state.toolCalls}\n knowledge={state.knowledge}\n memory={state.memory}\n status={state.status}\n elapsedTime={elapsedTime}\n />\n\n {/* Thinking Content - collapsible with max-height */}\n <ThinkingSection\n content={state.thinking}\n isExpanded={thinkingExpanded}\n />\n </>\n )}\n\n {/* Response Section */}\n {state.response && (\n <div\n className={cn(\n \"bg-muted/50 p-4\",\n showMetadataRow && \"border-t border-border\"\n )}\n >\n {renderMarkdown ? (\n renderMarkdown(state.response)\n ) : (\n <span className=\"whitespace-pre-wrap\">{state.response}</span>\n )}\n </div>\n )}\n </div>\n\n {/* Action Bar - outside the message container, visible on hover when complete */}\n {showActionBar && (\n <ActionBar\n response={state.response}\n isVisible={isActionBarVisible}\n totalTimeSeconds={totalTimeSeconds}\n feedback={feedback}\n onFeedbackChange={onFeedbackChange}\n onResponseCopy={onResponseCopy}\n />\n )}\n </div>\n );\n }\n);\nAgentResponse.displayName = \"AgentResponse\";\n\nexport { AgentResponse };\n","import * as React from \"react\";\nimport { cn } from \"@optilogic/core\";\n\nexport interface UserPromptProps extends React.HTMLAttributes<HTMLDivElement> {\n /** The text content of the user's message */\n content: string;\n /** Optional timestamp to display below the message */\n timestamp?: Date;\n}\n\n/**\n * UserPrompt component\n *\n * Displays a user's chat message in a styled bubble.\n * Used alongside AgentResponse to create chat interfaces.\n *\n * @example\n * ```tsx\n * <UserPrompt\n * content=\"What is the weather today?\"\n * timestamp={new Date()}\n * />\n * ```\n *\n * @example\n * ```tsx\n * // Custom styling\n * <UserPrompt\n * content=\"Hello world\"\n * className=\"max-w-full\"\n * />\n * ```\n */\nexport const UserPrompt = React.forwardRef<HTMLDivElement, UserPromptProps>(\n ({ content, timestamp, className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\n \"w-fit max-w-[80%] rounded-lg px-4 pt-3.5 pb-3\",\n \"bg-secondary text-secondary-foreground\",\n className\n )}\n {...props}\n >\n <p className=\"whitespace-pre-wrap\">{content}</p>\n {timestamp && (\n <p className=\"text-xs text-secondary-foreground/70 mt-1\">\n {timestamp.toLocaleTimeString([], {\n hour: \"2-digit\",\n minute: \"2-digit\",\n })}\n </p>\n )}\n </div>\n );\n }\n);\n\nUserPrompt.displayName = \"UserPrompt\";\n","import * as React from \"react\";\nimport { Send, Loader2 } from \"lucide-react\";\nimport { cn, IconButton } from \"@optilogic/core\";\nimport {\n SlateEditor,\n Text,\n type SlateEditorRef,\n type NodeEntry,\n type DecoratedRange,\n type RenderLeafProps,\n} from \"@optilogic/editor\";\nimport type { UserPromptInputProps, UserPromptInputRef } from \"./types\";\n\n/**\n * Creates a decorate function that highlights code blocks.\n * Handles both complete (```...```) and unclosed (```...) code blocks.\n */\nfunction createCodeBlockDecorate(entry: NodeEntry): DecoratedRange[] {\n const [node, path] = entry;\n const ranges: DecoratedRange[] = [];\n\n if (!Text.isText(node)) {\n return ranges;\n }\n\n const { text } = node;\n\n // Find all ``` positions\n const backtickPositions: number[] = [];\n let searchStart = 0;\n while (true) {\n const pos = text.indexOf(\"```\", searchStart);\n if (pos === -1) break;\n backtickPositions.push(pos);\n searchStart = pos + 3;\n }\n\n // Process pairs of backticks (and handle unclosed blocks)\n let i = 0;\n while (i < backtickPositions.length) {\n const openPos = backtickPositions[i];\n const closePos = backtickPositions[i + 1];\n\n // Mark opening delimiter\n ranges.push({\n anchor: { path, offset: openPos },\n focus: { path, offset: openPos + 3 },\n codeDelimiter: true,\n } as DecoratedRange);\n\n if (closePos !== undefined) {\n // Complete code block - mark content and closing delimiter\n if (closePos > openPos + 3) {\n ranges.push({\n anchor: { path, offset: openPos + 3 },\n focus: { path, offset: closePos },\n codeBlock: true,\n } as DecoratedRange);\n }\n ranges.push({\n anchor: { path, offset: closePos },\n focus: { path, offset: closePos + 3 },\n codeDelimiter: true,\n } as DecoratedRange);\n i += 2; // Move past both opening and closing\n } else {\n // Unclosed code block - mark everything to end as code\n if (text.length > openPos + 3) {\n ranges.push({\n anchor: { path, offset: openPos + 3 },\n focus: { path, offset: text.length },\n codeBlock: true,\n } as DecoratedRange);\n }\n i += 1; // Move past opening only\n }\n }\n\n return ranges;\n}\n\n/**\n * Custom leaf renderer for code block styling\n */\nfunction CodeBlockLeaf({ attributes, children, leaf }: RenderLeafProps) {\n const leafAny = leaf as { codeBlock?: boolean; codeDelimiter?: boolean };\n\n if (leafAny.codeBlock) {\n return (\n <span\n {...attributes}\n className=\"bg-muted/50 text-muted-foreground font-mono text-sm rounded px-1\"\n >\n {children}\n </span>\n );\n }\n\n if (leafAny.codeDelimiter) {\n return (\n <span\n {...attributes}\n className=\"text-muted-foreground/50 font-mono text-sm\"\n >\n {children}\n </span>\n );\n }\n\n return <span {...attributes}>{children}</span>;\n}\n\n/**\n * UserPromptInput Component\n *\n * A rich text input for user messages that wraps SlateEditor.\n * Features:\n * - Code block styling with triple backticks\n * - Send button with loading state\n * - Action slot for additional buttons\n * - Tag support (optional)\n *\n * @example\n * <UserPromptInput\n * placeholder=\"Type your message...\"\n * onSubmit={(text) => sendMessage(text)}\n * renderActions={() => (\n * <IconButton icon={<Paperclip />} aria-label=\"Attach file\" />\n * )}\n * />\n */\nexport const UserPromptInput = React.forwardRef<\n UserPromptInputRef,\n UserPromptInputProps\n>(\n (\n {\n value = \"\",\n onChange,\n onSubmit,\n clearOnSubmit = true,\n placeholder = \"Type your message...\",\n disabled = false,\n isSubmitting = false,\n minRows = 1,\n maxRows = 6,\n renderActions,\n enableTags = false,\n onTagCreate,\n onTagDelete,\n className,\n ...props\n },\n ref\n ) => {\n const editorRef = React.useRef<SlateEditorRef>(null);\n const [internalValue, setInternalValue] = React.useState(value);\n\n // Sync internal value with prop\n React.useEffect(() => {\n setInternalValue(value);\n }, [value]);\n\n // Expose ref methods\n React.useImperativeHandle(\n ref,\n () => ({\n focus: () => editorRef.current?.focus(),\n clear: () => {\n editorRef.current?.clear();\n setInternalValue(\"\");\n },\n getText: () => editorRef.current?.getText() ?? \"\",\n insertText: (text: string) => editorRef.current?.insertText(text),\n }),\n []\n );\n\n const handleChange = React.useCallback(\n (newValue: string) => {\n setInternalValue(newValue);\n onChange?.(newValue);\n },\n [onChange]\n );\n\n const handleSubmit = React.useCallback(\n (text: string) => {\n if (disabled || isSubmitting) return;\n if (!text.trim()) return;\n\n onSubmit?.(text.trim());\n\n if (clearOnSubmit) {\n editorRef.current?.clear();\n setInternalValue(\"\");\n }\n },\n [disabled, isSubmitting, onSubmit, clearOnSubmit]\n );\n\n const handleSendClick = React.useCallback(() => {\n const text = editorRef.current?.getText() ?? \"\";\n handleSubmit(text);\n }, [handleSubmit]);\n\n const hasContent = internalValue.trim().length > 0;\n const canSubmit = hasContent && !disabled && !isSubmitting;\n\n return (\n <div\n className={cn(\n \"rounded-lg border border-input bg-background\",\n disabled && \"opacity-50 cursor-not-allowed\",\n className\n )}\n {...props}\n >\n {/* Editor area */}\n <div className=\"pl-2 pr-0 pt-1 pb-1\">\n <SlateEditor\n ref={editorRef}\n value={internalValue}\n onChange={handleChange}\n onSubmit={handleSubmit}\n clearOnSubmit={false}\n placeholder={placeholder}\n disabled={disabled || isSubmitting}\n enableTags={enableTags}\n onTagCreate={onTagCreate}\n onTagDelete={onTagDelete}\n minRows={minRows}\n maxRows={maxRows}\n decorate={createCodeBlockDecorate}\n renderLeaf={CodeBlockLeaf}\n />\n </div>\n\n {/* Actions row */}\n <div className=\"flex items-center justify-between pl-2 pr-1 pb-1 pt-1\">\n {/* Left actions slot */}\n <div className=\"flex items-center gap-1\">{renderActions?.()}</div>\n\n {/* Send button */}\n <IconButton\n icon={\n isSubmitting ? (\n <Loader2 className=\"animate-spin\" />\n ) : (\n <Send />\n )\n }\n variant=\"filled\"\n size=\"sm\"\n aria-label={isSubmitting ? \"Sending...\" : \"Send message\"}\n disabled={!canSubmit}\n onClick={handleSendClick}\n />\n </div>\n </div>\n );\n }\n);\n\nUserPromptInput.displayName = \"UserPromptInput\";\n"]}
package/dist/index.d.cts CHANGED
@@ -375,4 +375,95 @@ declare function formatTime(seconds: number, isComplete: boolean): string;
375
375
  */
376
376
  declare function formatTotalTime(seconds: number): string;
377
377
 
378
- export { ActionBar, type ActionBarProps, ActivityIndicators, type ActivityIndicatorsProps, type AgentMessage, AgentResponse, type AgentResponseProps, type AgentResponseState, type AgentResponseStatus, type FeedbackValue, type GenericWebSocketMessage, type KnowledgeItem, type MemoryItem, MetadataRow, type MetadataRowProps, ThinkingSection, type ThinkingSectionProps, type ToolCall, type UseAgentResponseAccumulatorOptions, type UseAgentResponseAccumulatorReturn, type UseThinkingTimerOptions, formatTime, formatTotalTime, initialAgentResponseState, useAgentResponseAccumulator, useThinkingTimer };
378
+ interface UserPromptProps extends React.HTMLAttributes<HTMLDivElement> {
379
+ /** The text content of the user's message */
380
+ content: string;
381
+ /** Optional timestamp to display below the message */
382
+ timestamp?: Date;
383
+ }
384
+ /**
385
+ * UserPrompt component
386
+ *
387
+ * Displays a user's chat message in a styled bubble.
388
+ * Used alongside AgentResponse to create chat interfaces.
389
+ *
390
+ * @example
391
+ * ```tsx
392
+ * <UserPrompt
393
+ * content="What is the weather today?"
394
+ * timestamp={new Date()}
395
+ * />
396
+ * ```
397
+ *
398
+ * @example
399
+ * ```tsx
400
+ * // Custom styling
401
+ * <UserPrompt
402
+ * content="Hello world"
403
+ * className="max-w-full"
404
+ * />
405
+ * ```
406
+ */
407
+ declare const UserPrompt: React.ForwardRefExoticComponent<UserPromptProps & React.RefAttributes<HTMLDivElement>>;
408
+
409
+ interface UserPromptInputProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange" | "onSubmit"> {
410
+ /** Current text value */
411
+ value?: string;
412
+ /** Callback when text changes */
413
+ onChange?: (value: string) => void;
414
+ /** Callback when user submits (Enter key or send button) */
415
+ onSubmit?: (text: string) => void;
416
+ /** Clear input after submit (default: true) */
417
+ clearOnSubmit?: boolean;
418
+ /** Placeholder text */
419
+ placeholder?: string;
420
+ /** Whether the input is disabled */
421
+ disabled?: boolean;
422
+ /** Whether a submission is in progress (shows loading state) */
423
+ isSubmitting?: boolean;
424
+ /** Minimum number of rows for the editor */
425
+ minRows?: number;
426
+ /** Maximum number of rows before scrolling */
427
+ maxRows?: number;
428
+ /** Render function for additional action buttons (left side) */
429
+ renderActions?: () => React.ReactNode;
430
+ /** Enable tag detection with # character */
431
+ enableTags?: boolean;
432
+ /** Callback when a tag is created */
433
+ onTagCreate?: (tag: string) => void;
434
+ /** Callback when a tag is deleted */
435
+ onTagDelete?: (tag: string) => void;
436
+ }
437
+ interface UserPromptInputRef {
438
+ /** Focus the editor */
439
+ focus: () => void;
440
+ /** Clear the editor content */
441
+ clear: () => void;
442
+ /** Get the current text content */
443
+ getText: () => string;
444
+ /** Insert text at cursor position */
445
+ insertText: (text: string) => void;
446
+ }
447
+
448
+ /**
449
+ * UserPromptInput Component
450
+ *
451
+ * A rich text input for user messages that wraps SlateEditor.
452
+ * Features:
453
+ * - Code block styling with triple backticks
454
+ * - Send button with loading state
455
+ * - Action slot for additional buttons
456
+ * - Tag support (optional)
457
+ *
458
+ * @example
459
+ * <UserPromptInput
460
+ * placeholder="Type your message..."
461
+ * onSubmit={(text) => sendMessage(text)}
462
+ * renderActions={() => (
463
+ * <IconButton icon={<Paperclip />} aria-label="Attach file" />
464
+ * )}
465
+ * />
466
+ */
467
+ declare const UserPromptInput: React.ForwardRefExoticComponent<UserPromptInputProps & React.RefAttributes<UserPromptInputRef>>;
468
+
469
+ export { ActionBar, type ActionBarProps, ActivityIndicators, type ActivityIndicatorsProps, type AgentMessage, AgentResponse, type AgentResponseProps, type AgentResponseState, type AgentResponseStatus, type FeedbackValue, type GenericWebSocketMessage, type KnowledgeItem, type MemoryItem, MetadataRow, type MetadataRowProps, ThinkingSection, type ThinkingSectionProps, type ToolCall, type UseAgentResponseAccumulatorOptions, type UseAgentResponseAccumulatorReturn, type UseThinkingTimerOptions, UserPrompt, UserPromptInput, type UserPromptInputProps, type UserPromptInputRef, type UserPromptProps, formatTime, formatTotalTime, initialAgentResponseState, useAgentResponseAccumulator, useThinkingTimer };
package/dist/index.d.ts CHANGED
@@ -375,4 +375,95 @@ declare function formatTime(seconds: number, isComplete: boolean): string;
375
375
  */
376
376
  declare function formatTotalTime(seconds: number): string;
377
377
 
378
- export { ActionBar, type ActionBarProps, ActivityIndicators, type ActivityIndicatorsProps, type AgentMessage, AgentResponse, type AgentResponseProps, type AgentResponseState, type AgentResponseStatus, type FeedbackValue, type GenericWebSocketMessage, type KnowledgeItem, type MemoryItem, MetadataRow, type MetadataRowProps, ThinkingSection, type ThinkingSectionProps, type ToolCall, type UseAgentResponseAccumulatorOptions, type UseAgentResponseAccumulatorReturn, type UseThinkingTimerOptions, formatTime, formatTotalTime, initialAgentResponseState, useAgentResponseAccumulator, useThinkingTimer };
378
+ interface UserPromptProps extends React.HTMLAttributes<HTMLDivElement> {
379
+ /** The text content of the user's message */
380
+ content: string;
381
+ /** Optional timestamp to display below the message */
382
+ timestamp?: Date;
383
+ }
384
+ /**
385
+ * UserPrompt component
386
+ *
387
+ * Displays a user's chat message in a styled bubble.
388
+ * Used alongside AgentResponse to create chat interfaces.
389
+ *
390
+ * @example
391
+ * ```tsx
392
+ * <UserPrompt
393
+ * content="What is the weather today?"
394
+ * timestamp={new Date()}
395
+ * />
396
+ * ```
397
+ *
398
+ * @example
399
+ * ```tsx
400
+ * // Custom styling
401
+ * <UserPrompt
402
+ * content="Hello world"
403
+ * className="max-w-full"
404
+ * />
405
+ * ```
406
+ */
407
+ declare const UserPrompt: React.ForwardRefExoticComponent<UserPromptProps & React.RefAttributes<HTMLDivElement>>;
408
+
409
+ interface UserPromptInputProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange" | "onSubmit"> {
410
+ /** Current text value */
411
+ value?: string;
412
+ /** Callback when text changes */
413
+ onChange?: (value: string) => void;
414
+ /** Callback when user submits (Enter key or send button) */
415
+ onSubmit?: (text: string) => void;
416
+ /** Clear input after submit (default: true) */
417
+ clearOnSubmit?: boolean;
418
+ /** Placeholder text */
419
+ placeholder?: string;
420
+ /** Whether the input is disabled */
421
+ disabled?: boolean;
422
+ /** Whether a submission is in progress (shows loading state) */
423
+ isSubmitting?: boolean;
424
+ /** Minimum number of rows for the editor */
425
+ minRows?: number;
426
+ /** Maximum number of rows before scrolling */
427
+ maxRows?: number;
428
+ /** Render function for additional action buttons (left side) */
429
+ renderActions?: () => React.ReactNode;
430
+ /** Enable tag detection with # character */
431
+ enableTags?: boolean;
432
+ /** Callback when a tag is created */
433
+ onTagCreate?: (tag: string) => void;
434
+ /** Callback when a tag is deleted */
435
+ onTagDelete?: (tag: string) => void;
436
+ }
437
+ interface UserPromptInputRef {
438
+ /** Focus the editor */
439
+ focus: () => void;
440
+ /** Clear the editor content */
441
+ clear: () => void;
442
+ /** Get the current text content */
443
+ getText: () => string;
444
+ /** Insert text at cursor position */
445
+ insertText: (text: string) => void;
446
+ }
447
+
448
+ /**
449
+ * UserPromptInput Component
450
+ *
451
+ * A rich text input for user messages that wraps SlateEditor.
452
+ * Features:
453
+ * - Code block styling with triple backticks
454
+ * - Send button with loading state
455
+ * - Action slot for additional buttons
456
+ * - Tag support (optional)
457
+ *
458
+ * @example
459
+ * <UserPromptInput
460
+ * placeholder="Type your message..."
461
+ * onSubmit={(text) => sendMessage(text)}
462
+ * renderActions={() => (
463
+ * <IconButton icon={<Paperclip />} aria-label="Attach file" />
464
+ * )}
465
+ * />
466
+ */
467
+ declare const UserPromptInput: React.ForwardRefExoticComponent<UserPromptInputProps & React.RefAttributes<UserPromptInputRef>>;
468
+
469
+ export { ActionBar, type ActionBarProps, ActivityIndicators, type ActivityIndicatorsProps, type AgentMessage, AgentResponse, type AgentResponseProps, type AgentResponseState, type AgentResponseStatus, type FeedbackValue, type GenericWebSocketMessage, type KnowledgeItem, type MemoryItem, MetadataRow, type MetadataRowProps, ThinkingSection, type ThinkingSectionProps, type ToolCall, type UseAgentResponseAccumulatorOptions, type UseAgentResponseAccumulatorReturn, type UseThinkingTimerOptions, UserPrompt, UserPromptInput, type UserPromptInputProps, type UserPromptInputRef, type UserPromptProps, formatTime, formatTotalTime, initialAgentResponseState, useAgentResponseAccumulator, useThinkingTimer };