@tangle-network/ui 11.48.0 → 11.49.0

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @tangle-network/ui
2
2
 
3
+ ## 11.49.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 29e2a49: `statusMeta(status)` returns the one `{ label, icon, token }` for Running, Waiting, Needs you, Done, Failed, Stopped, Idle and Unknown, and `RunStatusIcon` draws it on the 16px lucide grid at stroke 1.75. `runStatus` maps the vocabularies ui already speaks (completed, error, attention-needed, cancelled …) and reads anything else as Unknown. Failed is always CircleX; only Needs you takes the warning amber; Running breathes on `--motion-ambient` instead of spinning. `RunPhaseList`, `ExpandedToolDetail` and `RunGroup` render their status through it, so a failed phase reads "Failed" with CircleX and a finished run reads "Done" with CircleCheck.
8
+
3
9
  ## 11.48.0
4
10
 
5
11
  ### Minor Changes
package/dist/index.d.ts CHANGED
@@ -118,6 +118,7 @@ import { LiveDuration } from "./run/run-item-primitives.js";
118
118
  import { TaskList, TaskListItem, TaskListProps, TaskStatus, showsTaskPriority, taskProgress, taskStatus } from "./run/task-list.js";
119
119
  import { ApprovalCard, ApprovalCardProps, ApprovalDiffFile, ApprovalDiffSummary, ApprovalPlanStep } from "./run/approval-card.js";
120
120
  import { RunPhase, RunPhaseList } from "./run/run-phase-list.js";
121
+ import { RunStatus, RunStatusIcon, RunStatusIconProps, StatusMeta, runStatus, statusMeta } from "./run/status-meta.js";
121
122
  import "./run.js";
122
123
  import { OPENUI_NODE_JSON_SCHEMA, OPENUI_NODE_TYPES } from "./openui/schema-data.js";
123
124
  import { OpenUISchemaIssue, OpenUISchemaValidation, findUnsupportedOpenUINode, validateOpenUIJsonArtifact, validateOpenUIJsonNode } from "./openui-schema.js";
@@ -144,4 +145,4 @@ import { QuestionPreview, QuestionPreviewProps } from "./tool-previews/question-
144
145
  import { DiffPreview, DiffPreviewProps } from "./tool-previews/diff-preview.js";
145
146
  import { RedactedDocSegment, RedactedDocument, RedactedDocumentData, RedactedDocumentProps, RevealResult } from "./redaction/redacted-document.js";
146
147
  import "./redaction.js";
147
- export { ActiveProjectActivity, ActiveSessionActivityOptions, ActiveSessionConnectionOptions, ActiveSessionConnectionState, ActiveSessionReconnectState, ActiveSessionRecord, ActiveSessionStatus, ActiveSessionTransportMode, ActiveSessionsState, AgentBranding, AgentStreamEvent, AgentTimeline, type AgentTimelineArtifactItem, AgentTimelineColumn, type AgentTimelineCustomItem, type AgentTimelineItem, type AgentTimelineMessageItem, type AgentTimelineProps, type AgentTimelineStatusItem, AgentTimelineStep, type AgentTimelineStepKind, type AgentTimelineStepProps, type AgentTimelineTone, type AgentTimelineToolGroupItem, type AgentTimelineToolItem, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, type AlertProps, AlertTitle, type AlertTone, ApiSchema, type ApiSchemaProps, AppendUserMessageOptions, ApplySdkEventOptions, ApprovalCard, type ApprovalCardProps, type ApprovalDiffFile, ApprovalDiffSummary, type ApprovalPlanStep, ArtifactPane, type ArtifactPaneProps, AuthHeader, type AuthHeaderProps, AuthUser, AutomationStreamEvent, Avatar, AvatarFallback, AvatarImage, type AvatarProps, Badge, type BadgeProps, BeginAssistantMessageOptions, BotStreamEvent, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, type ButtonProps, CATEGORY_TONES, CSV_PREVIEW_ROW_LIMIT, Calendar, type CalendarDate, type CalendarProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type CardTitleProps, type CategoryTone, type ChartReferenceLine, ChatAuthor, ChatContainer, type ChatContainerProps, ChatMessage, type ChatMessageProps, Checkbox, Chip, type ChipProps, CodeBlock, type CodeBlockProps, Collapsible, CollapsibleContent, CollapsibleTrigger, CommandPreview, type CommandPreviewProps, CompleteAssistantMessageOptions, ComplianceBadge, type ComplianceBadgeProps, type ComplianceProduct, type ComplianceStatus, ConnectionState, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, CopyButton, type CopyButtonProps, CustomToolRenderer, DatePicker, type DatePickerProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DiffPreview, type DiffPreviewProps, DisplayVariant, DropZone, type DropZoneProps, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, type EmptyStateProps, ExpandedToolDetail, type ExpandedToolDetailProps, type FeedSegment, Field, type FieldProps, FileArtifactPane, type FileArtifactPaneProps, FileCard, type FileCardProps, type FileDetails, type FileFormat, FileList, type FileListItem, type FileListProps, type FileNode, FilePreview, type FilePreviewKind, type FilePreviewProps, type FileTabData, FileTabs, type FileTabsProps, FileTree, type FileTreeProps, type FileTreeVisibilityOptions, type FileUploader, FilterField, type FilterFieldProps, FinalTextPart, GitHubLoginButton, type GitHubLoginButtonProps, GlobResultsPreview, type GlobResultsPreviewProps, GrepResultsPreview, type GrepResultsPreviewProps, GroupedMessage, Heading, type HeadingProps, type HeadingVariant, HelpText, type HelpTextProps, HoverCard, HoverCardContent, HoverCardDescription, HoverCardHeader, HoverCardTitle, HoverCardTrigger, IconTile, type IconTileProps, InlineCode, type InlineCodeProps, InlineThinkingItem, type InlineThinkingItemProps, InlineToolItem, type InlineToolItemProps, Input, type InputProps, Label, LiveDuration, LoginLayout, type LoginLayoutProps, Logo, type LogoProps, Markdown, type MarkdownLinkChip, type MarkdownLinkChipResolver, type MarkdownProps, MessageAuthor, type MessageAuthorProps, MessageList, type MessageListProps, type MessageRole, MessageRun, MessageUser, Metric, MetricChart, type MetricChartProps, type MetricProps, MetricStrip, type MetricStripProps, OPENUI_NODE_JSON_SCHEMA, OPENUI_NODE_TYPES, type OpenUIAction, type OpenUIActionsNode, OpenUIArtifactRenderer, type OpenUIArtifactRendererProps, type OpenUIBadgeNode, type OpenUICardNode, type OpenUICodeNode, type OpenUIComponentNode, type OpenUIGridNode, type OpenUIHeadingNode, type OpenUIKeyValueNode, type OpenUIMarkdownNode, type OpenUIPrimitive, type OpenUISchemaIssue, type OpenUISchemaValidation, type OpenUISeparatorNode, type OpenUIStackNode, type OpenUIStatNode, type OpenUITableNode, type OpenUITextNode, PageHeader, type PageHeaderProps, PageShell, type PageShellProps, Pagination, type PaginationProps, PdfViewer, type PdfViewerConfig, type PdfViewerProps, type PeriodDelta, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverTrigger, Progress, QuestionPreview, type QuestionPreviewProps, RadioGroup, RadioGroupItem, RealtimeSessionOptions, RealtimeSessionRegistry, RealtimeSessionRegistryProps, RealtimeSessionState, RealtimeSessionTarget, ReasoningPart, type RedactedDocSegment, RedactedDocument, type RedactedDocumentData, type RedactedDocumentProps, RegisterActiveSessionOptions, type RevealResult, RichFileTree, type RichFileTreeGitEntry, type RichFileTreeGitStatus, type RichFileTreeProps, type RichFileTreeThemeVars, Run, RunGroup, type RunGroupProps, type RunPhase, RunPhaseList, RunRowShell, type RunRowShellProps, type RunRowStatus, RunRowStatusDot, RunStats, SSEEvent, SdkSessionAttachment, SdkSessionEvent, SdkSessionSeed, SegmentedControl, type SegmentedControlOption, type SegmentedControlProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, type SeriesExtent, type SeriesPoint, type SeriesPointInput, type SeriesScale, SeriesSparkline, type SeriesSparklineProps, SessionMessage, SessionPart, SessionProjectKey, type SessionUser, SettingsList, type SettingsListAction, type SettingsListColumns, SettingsListItem, type SettingsListItemProps, type SettingsListMenuItem, type SettingsListProps, SettingsRow, type SettingsRowLayout, type SettingsRowProps, SettingsSection, type SettingsSectionProps, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, SidebarDropZone, type SidebarDropZoneProps, Skeleton, SkeletonCard, SkeletonTable, Slider, type Speaker, SpeakerHeader, type SpeakerHeaderProps, type SpeakerPart, type SpeakerSection, type SpeakerState, StatCard, type StatCardProps, StatusPill, type StatusPillProps, type StatusTone, Switch, TONE_CLASSES, TOOL_CATEGORY_ICONS, TRANSCRIPT_TEXT, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, type TableProps, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tag, type TagProps, TangleKnot, TaskList, type TaskListItem, type TaskListProps, type TaskStatus, TaskStreamEvent, TerminalCursor, TerminalDisplay, TerminalInput, TerminalLine, TerminalStreamEvent, TextPart, TextShimmer, type TextShimmerProps, Textarea, type TextareaProps, ThemeToggle, ThinkingIndicator, type ThinkingIndicatorProps, TimeSelect, type TimeSelectProps, type Toast, ToastContainer, ToastProvider, type Tone, type ToneClasses, type ToolCallData, ToolCallFeed, type ToolCallFeedProps, type ToolCallStatus, type ToolCallType, ToolCategory, ToolDisplayMetadata, ToolPart, ToolState, ToolStatus, ToolTime, Toolbar, type ToolbarProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type UploadFile, UploadProgress, type UploadProgressProps, UseAuthOptions, UseAuthResult, UseRunGroupsOptions, UseSSEStreamOptions, UseSSEStreamResult, UseSdkSessionOptions, UseSdkSessionReturn, UseToolCallStreamReturn, UserMenu, type UserMenuProps, UserMessage, type UserMessageProps, WebSearchPreview, type WebSearchPreviewProps, Wizard, type WizardProps, WizardStep, type WizardStepProps, WriteFilePreview, type WriteFilePreviewProps, activeSessionsAtom, addMessage, addParts, agentTimelineStepKind, badgeVariants, bumpActiveSessionActivity, buttonVariants, clearChat, cn, codeBlockGrammar, configurePdfViewer, copyText, createAuthFetcher, detectFileFormat, fenceInfo, fieldMessageId, fileExtension, filterFileTree, findUnsupportedOpenUINode, focusField, focusFieldInvalid, focusFieldWithin, focusRing, focusRingInset, formatBytes, formatCalendarDate, formatDuration, formatUptime, getActiveSession, getAllActiveSessions, getAllProjectActivity, getCodeLanguage, getFormatLabel, getSanitizedMarkdownHeadingIdFromRawFragment, getSessionsByActivity, getSessionsForNavbar, getSessionsForProject, getSyntaxLanguage, getToolCategory, getToolDisplayMetadata, getToolErrorText, getTotalRunningSessionCount, hasBackgroundRunningSessions, initialsOf, isStreamingAtom, isViewerMessage, ixControl, ixControlAfter, ixControlSoft, ixField, ixRow, ixSelected, ixTabUnderline, localToday, messagesAtom, normalizeSeries, numericColumns, parseCalendarDate, parseCsv, parseToolEvent, partMapAtom, partitionBySpeaker, periodDelta, plainTextFromMarkdown, registerActiveSession, resetActiveSessions, resolveFilePreviewKind, seriesAreaPath, seriesExtent, seriesLinePath, seriesMean, seriesScale, setActiveSessionAttention, setActiveSessionConnection, setActiveSessionError, setActiveSessionRunning, setForegroundActiveSession, showsTaskPriority, tableCsv, taskProgress, taskStatus, timeAgo, toneFor, truncateText, unregisterActiveSession, updateActiveSessionMeta, updatePart, useActiveSession, useActiveSessions, useActiveSessionsState, useApiKey, useAuth, useAutoScroll, useDropdownMenu, useHasBackgroundRunningSessions, useLiveTime, useNavbarSessions, useProjectActivity, useProjectSessions, useRealtimeSession, useRunCollapseState, useRunGroups, useSSEStream, useSdkSession, useSessionsByActivity, useTheme, useToast, useToolCallStream, useTotalRunningSessions, validateOpenUIJsonArtifact, validateOpenUIJsonNode };
148
+ export { ActiveProjectActivity, ActiveSessionActivityOptions, ActiveSessionConnectionOptions, ActiveSessionConnectionState, ActiveSessionReconnectState, ActiveSessionRecord, ActiveSessionStatus, ActiveSessionTransportMode, ActiveSessionsState, AgentBranding, AgentStreamEvent, AgentTimeline, type AgentTimelineArtifactItem, AgentTimelineColumn, type AgentTimelineCustomItem, type AgentTimelineItem, type AgentTimelineMessageItem, type AgentTimelineProps, type AgentTimelineStatusItem, AgentTimelineStep, type AgentTimelineStepKind, type AgentTimelineStepProps, type AgentTimelineTone, type AgentTimelineToolGroupItem, type AgentTimelineToolItem, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, type AlertProps, AlertTitle, type AlertTone, ApiSchema, type ApiSchemaProps, AppendUserMessageOptions, ApplySdkEventOptions, ApprovalCard, type ApprovalCardProps, type ApprovalDiffFile, ApprovalDiffSummary, type ApprovalPlanStep, ArtifactPane, type ArtifactPaneProps, AuthHeader, type AuthHeaderProps, AuthUser, AutomationStreamEvent, Avatar, AvatarFallback, AvatarImage, type AvatarProps, Badge, type BadgeProps, BeginAssistantMessageOptions, BotStreamEvent, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, type ButtonProps, CATEGORY_TONES, CSV_PREVIEW_ROW_LIMIT, Calendar, type CalendarDate, type CalendarProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type CardTitleProps, type CategoryTone, type ChartReferenceLine, ChatAuthor, ChatContainer, type ChatContainerProps, ChatMessage, type ChatMessageProps, Checkbox, Chip, type ChipProps, CodeBlock, type CodeBlockProps, Collapsible, CollapsibleContent, CollapsibleTrigger, CommandPreview, type CommandPreviewProps, CompleteAssistantMessageOptions, ComplianceBadge, type ComplianceBadgeProps, type ComplianceProduct, type ComplianceStatus, ConnectionState, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, CopyButton, type CopyButtonProps, CustomToolRenderer, DatePicker, type DatePickerProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DiffPreview, type DiffPreviewProps, DisplayVariant, DropZone, type DropZoneProps, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, type EmptyStateProps, ExpandedToolDetail, type ExpandedToolDetailProps, type FeedSegment, Field, type FieldProps, FileArtifactPane, type FileArtifactPaneProps, FileCard, type FileCardProps, type FileDetails, type FileFormat, FileList, type FileListItem, type FileListProps, type FileNode, FilePreview, type FilePreviewKind, type FilePreviewProps, type FileTabData, FileTabs, type FileTabsProps, FileTree, type FileTreeProps, type FileTreeVisibilityOptions, type FileUploader, FilterField, type FilterFieldProps, FinalTextPart, GitHubLoginButton, type GitHubLoginButtonProps, GlobResultsPreview, type GlobResultsPreviewProps, GrepResultsPreview, type GrepResultsPreviewProps, GroupedMessage, Heading, type HeadingProps, type HeadingVariant, HelpText, type HelpTextProps, HoverCard, HoverCardContent, HoverCardDescription, HoverCardHeader, HoverCardTitle, HoverCardTrigger, IconTile, type IconTileProps, InlineCode, type InlineCodeProps, InlineThinkingItem, type InlineThinkingItemProps, InlineToolItem, type InlineToolItemProps, Input, type InputProps, Label, LiveDuration, LoginLayout, type LoginLayoutProps, Logo, type LogoProps, Markdown, type MarkdownLinkChip, type MarkdownLinkChipResolver, type MarkdownProps, MessageAuthor, type MessageAuthorProps, MessageList, type MessageListProps, type MessageRole, MessageRun, MessageUser, Metric, MetricChart, type MetricChartProps, type MetricProps, MetricStrip, type MetricStripProps, OPENUI_NODE_JSON_SCHEMA, OPENUI_NODE_TYPES, type OpenUIAction, type OpenUIActionsNode, OpenUIArtifactRenderer, type OpenUIArtifactRendererProps, type OpenUIBadgeNode, type OpenUICardNode, type OpenUICodeNode, type OpenUIComponentNode, type OpenUIGridNode, type OpenUIHeadingNode, type OpenUIKeyValueNode, type OpenUIMarkdownNode, type OpenUIPrimitive, type OpenUISchemaIssue, type OpenUISchemaValidation, type OpenUISeparatorNode, type OpenUIStackNode, type OpenUIStatNode, type OpenUITableNode, type OpenUITextNode, PageHeader, type PageHeaderProps, PageShell, type PageShellProps, Pagination, type PaginationProps, PdfViewer, type PdfViewerConfig, type PdfViewerProps, type PeriodDelta, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverTrigger, Progress, QuestionPreview, type QuestionPreviewProps, RadioGroup, RadioGroupItem, RealtimeSessionOptions, RealtimeSessionRegistry, RealtimeSessionRegistryProps, RealtimeSessionState, RealtimeSessionTarget, ReasoningPart, type RedactedDocSegment, RedactedDocument, type RedactedDocumentData, type RedactedDocumentProps, RegisterActiveSessionOptions, type RevealResult, RichFileTree, type RichFileTreeGitEntry, type RichFileTreeGitStatus, type RichFileTreeProps, type RichFileTreeThemeVars, Run, RunGroup, type RunGroupProps, type RunPhase, RunPhaseList, RunRowShell, type RunRowShellProps, type RunRowStatus, RunRowStatusDot, RunStats, type RunStatus, RunStatusIcon, type RunStatusIconProps, SSEEvent, SdkSessionAttachment, SdkSessionEvent, SdkSessionSeed, SegmentedControl, type SegmentedControlOption, type SegmentedControlProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, type SeriesExtent, type SeriesPoint, type SeriesPointInput, type SeriesScale, SeriesSparkline, type SeriesSparklineProps, SessionMessage, SessionPart, SessionProjectKey, type SessionUser, SettingsList, type SettingsListAction, type SettingsListColumns, SettingsListItem, type SettingsListItemProps, type SettingsListMenuItem, type SettingsListProps, SettingsRow, type SettingsRowLayout, type SettingsRowProps, SettingsSection, type SettingsSectionProps, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, SidebarDropZone, type SidebarDropZoneProps, Skeleton, SkeletonCard, SkeletonTable, Slider, type Speaker, SpeakerHeader, type SpeakerHeaderProps, type SpeakerPart, type SpeakerSection, type SpeakerState, StatCard, type StatCardProps, type StatusMeta, StatusPill, type StatusPillProps, type StatusTone, Switch, TONE_CLASSES, TOOL_CATEGORY_ICONS, TRANSCRIPT_TEXT, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, type TableProps, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tag, type TagProps, TangleKnot, TaskList, type TaskListItem, type TaskListProps, type TaskStatus, TaskStreamEvent, TerminalCursor, TerminalDisplay, TerminalInput, TerminalLine, TerminalStreamEvent, TextPart, TextShimmer, type TextShimmerProps, Textarea, type TextareaProps, ThemeToggle, ThinkingIndicator, type ThinkingIndicatorProps, TimeSelect, type TimeSelectProps, type Toast, ToastContainer, ToastProvider, type Tone, type ToneClasses, type ToolCallData, ToolCallFeed, type ToolCallFeedProps, type ToolCallStatus, type ToolCallType, ToolCategory, ToolDisplayMetadata, ToolPart, ToolState, ToolStatus, ToolTime, Toolbar, type ToolbarProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type UploadFile, UploadProgress, type UploadProgressProps, UseAuthOptions, UseAuthResult, UseRunGroupsOptions, UseSSEStreamOptions, UseSSEStreamResult, UseSdkSessionOptions, UseSdkSessionReturn, UseToolCallStreamReturn, UserMenu, type UserMenuProps, UserMessage, type UserMessageProps, WebSearchPreview, type WebSearchPreviewProps, Wizard, type WizardProps, WizardStep, type WizardStepProps, WriteFilePreview, type WriteFilePreviewProps, activeSessionsAtom, addMessage, addParts, agentTimelineStepKind, badgeVariants, bumpActiveSessionActivity, buttonVariants, clearChat, cn, codeBlockGrammar, configurePdfViewer, copyText, createAuthFetcher, detectFileFormat, fenceInfo, fieldMessageId, fileExtension, filterFileTree, findUnsupportedOpenUINode, focusField, focusFieldInvalid, focusFieldWithin, focusRing, focusRingInset, formatBytes, formatCalendarDate, formatDuration, formatUptime, getActiveSession, getAllActiveSessions, getAllProjectActivity, getCodeLanguage, getFormatLabel, getSanitizedMarkdownHeadingIdFromRawFragment, getSessionsByActivity, getSessionsForNavbar, getSessionsForProject, getSyntaxLanguage, getToolCategory, getToolDisplayMetadata, getToolErrorText, getTotalRunningSessionCount, hasBackgroundRunningSessions, initialsOf, isStreamingAtom, isViewerMessage, ixControl, ixControlAfter, ixControlSoft, ixField, ixRow, ixSelected, ixTabUnderline, localToday, messagesAtom, normalizeSeries, numericColumns, parseCalendarDate, parseCsv, parseToolEvent, partMapAtom, partitionBySpeaker, periodDelta, plainTextFromMarkdown, registerActiveSession, resetActiveSessions, resolveFilePreviewKind, runStatus, seriesAreaPath, seriesExtent, seriesLinePath, seriesMean, seriesScale, setActiveSessionAttention, setActiveSessionConnection, setActiveSessionError, setActiveSessionRunning, setForegroundActiveSession, showsTaskPriority, statusMeta, tableCsv, taskProgress, taskStatus, timeAgo, toneFor, truncateText, unregisterActiveSession, updateActiveSessionMeta, updatePart, useActiveSession, useActiveSessions, useActiveSessionsState, useApiKey, useAuth, useAutoScroll, useDropdownMenu, useHasBackgroundRunningSessions, useLiveTime, useNavbarSessions, useProjectActivity, useProjectSessions, useRealtimeSession, useRunCollapseState, useRunGroups, useSSEStream, useSdkSession, useSessionsByActivity, useTheme, useToast, useToolCallStream, useTotalRunningSessions, validateOpenUIJsonArtifact, validateOpenUIJsonNode };
package/dist/index.js CHANGED
@@ -79,6 +79,7 @@ import { GlobResultsPreview } from "./tool-previews/glob-results-preview.js";
79
79
  import { WebSearchPreview } from "./tool-previews/web-search-preview.js";
80
80
  import { QuestionPreview } from "./tool-previews/question-preview.js";
81
81
  import { DiffPreview } from "./tool-previews/diff-preview.js";
82
+ import { RunStatusIcon, runStatus, statusMeta } from "./run/status-meta.js";
82
83
  import { ExpandedToolDetail } from "./run/expanded-tool-detail.js";
83
84
  import { RunRowShell, RunRowStatusDot } from "./run/run-row-shell.js";
84
85
  import { InlineToolItem } from "./run/inline-tool-item.js";
@@ -128,4 +129,4 @@ import { addMessage, addParts, clearChat, isStreamingAtom, messagesAtom, partMap
128
129
  import { copyText } from "./utils/copy-text.js";
129
130
  import { timeAgo } from "./utils/time-ago.js";
130
131
  import { RedactedDocument } from "./redaction/redacted-document.js";
131
- export { AgentTimeline, AgentTimelineColumn, AgentTimelineStep, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, ApiSchema, ApprovalCard, ApprovalDiffSummary, ArtifactPane, AuthHeader, Avatar, AvatarFallback, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, CATEGORY_TONES, CSV_PREVIEW_ROW_LIMIT, Calendar, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChatContainer, ChatMessage, Checkbox, Chip, CodeBlock, Collapsible, CollapsibleContent, CollapsibleTrigger, CommandPreview, ComplianceBadge, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, CopyButton, DatePicker, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DiffPreview, DropZone, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, ExpandedToolDetail, Field, FileArtifactPane, FileCard, FileList, FilePreview, FileTabs, FileTree, FilterField, GitHubLoginButton, GlobResultsPreview, GrepResultsPreview, Heading, HelpText, HoverCard, HoverCardContent, HoverCardDescription, HoverCardHeader, HoverCardTitle, HoverCardTrigger, IconTile, InlineCode, InlineThinkingItem, InlineToolItem, Input, Label, LiveDuration, LoginLayout, Logo, Markdown, MessageAuthor, MessageList, Metric, MetricChart, MetricStrip, OPENUI_NODE_JSON_SCHEMA, OPENUI_NODE_TYPES, OpenUIArtifactRenderer, PageHeader, PageShell, Pagination, PdfViewer, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverTrigger, Progress, QuestionPreview, RadioGroup, RadioGroupItem, RealtimeSessionRegistry, RedactedDocument, RichFileTree, RunGroup, RunPhaseList, RunRowShell, RunRowStatusDot, SegmentedControl, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, SeriesSparkline, SettingsList, SettingsListItem, SettingsRow, SettingsSection, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, SidebarDropZone, Skeleton, SkeletonCard, SkeletonTable, Slider, SpeakerHeader, StatCard, StatusPill, Switch, TONE_CLASSES, TOOL_CATEGORY_ICONS, TRANSCRIPT_TEXT, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tag, TangleKnot, TaskList, TerminalCursor, TerminalDisplay, TerminalInput, TerminalLine, TextShimmer, Textarea, ThemeToggle, ThinkingIndicator, TimeSelect, ToastContainer, ToastProvider, ToolCallFeed, Toolbar, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, UploadProgress, UserMenu, UserMessage, WebSearchPreview, Wizard, WizardStep, WriteFilePreview, activeSessionsAtom, addMessage, addParts, agentTimelineStepKind, badgeVariants, bumpActiveSessionActivity, buttonVariants, clearChat, cn, codeBlockGrammar, configurePdfViewer, copyText, createAuthFetcher, detectFileFormat, fenceInfo, fieldMessageId, fileExtension, filterFileTree, findUnsupportedOpenUINode, focusField, focusFieldInvalid, focusFieldWithin, focusRing, focusRingInset, formatBytes, formatCalendarDate, formatDuration, formatUptime, getActiveSession, getAllActiveSessions, getAllProjectActivity, getCodeLanguage, getFormatLabel, getSanitizedMarkdownHeadingIdFromRawFragment, getSessionsByActivity, getSessionsForNavbar, getSessionsForProject, getSyntaxLanguage, getToolCategory, getToolDisplayMetadata, getToolErrorText, getTotalRunningSessionCount, hasBackgroundRunningSessions, initialsOf, isStreamingAtom, isViewerMessage, ixControl, ixControlAfter, ixControlSoft, ixField, ixRow, ixSelected, ixTabUnderline, localToday, messagesAtom, normalizeSeries, numericColumns, parseCalendarDate, parseCsv, parseToolEvent, partMapAtom, partitionBySpeaker, periodDelta, plainTextFromMarkdown, registerActiveSession, resetActiveSessions, resolveFilePreviewKind, seriesAreaPath, seriesExtent, seriesLinePath, seriesMean, seriesScale, setActiveSessionAttention, setActiveSessionConnection, setActiveSessionError, setActiveSessionRunning, setForegroundActiveSession, showsTaskPriority, tableCsv, taskProgress, taskStatus, timeAgo, toneFor, truncateText, unregisterActiveSession, updateActiveSessionMeta, updatePart, useActiveSession, useActiveSessions, useActiveSessionsState, useApiKey, useAuth, useAutoScroll, useDropdownMenu, useHasBackgroundRunningSessions, useLiveTime, useNavbarSessions, useProjectActivity, useProjectSessions, useRealtimeSession, useRunCollapseState, useRunGroups, useSSEStream, useSdkSession, useSessionsByActivity, useTheme, useToast, useToolCallStream, useTotalRunningSessions, validateOpenUIJsonArtifact, validateOpenUIJsonNode };
132
+ export { AgentTimeline, AgentTimelineColumn, AgentTimelineStep, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, ApiSchema, ApprovalCard, ApprovalDiffSummary, ArtifactPane, AuthHeader, Avatar, AvatarFallback, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, CATEGORY_TONES, CSV_PREVIEW_ROW_LIMIT, Calendar, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChatContainer, ChatMessage, Checkbox, Chip, CodeBlock, Collapsible, CollapsibleContent, CollapsibleTrigger, CommandPreview, ComplianceBadge, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, CopyButton, DatePicker, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DiffPreview, DropZone, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, ExpandedToolDetail, Field, FileArtifactPane, FileCard, FileList, FilePreview, FileTabs, FileTree, FilterField, GitHubLoginButton, GlobResultsPreview, GrepResultsPreview, Heading, HelpText, HoverCard, HoverCardContent, HoverCardDescription, HoverCardHeader, HoverCardTitle, HoverCardTrigger, IconTile, InlineCode, InlineThinkingItem, InlineToolItem, Input, Label, LiveDuration, LoginLayout, Logo, Markdown, MessageAuthor, MessageList, Metric, MetricChart, MetricStrip, OPENUI_NODE_JSON_SCHEMA, OPENUI_NODE_TYPES, OpenUIArtifactRenderer, PageHeader, PageShell, Pagination, PdfViewer, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverTrigger, Progress, QuestionPreview, RadioGroup, RadioGroupItem, RealtimeSessionRegistry, RedactedDocument, RichFileTree, RunGroup, RunPhaseList, RunRowShell, RunRowStatusDot, RunStatusIcon, SegmentedControl, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, SeriesSparkline, SettingsList, SettingsListItem, SettingsRow, SettingsSection, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, SidebarDropZone, Skeleton, SkeletonCard, SkeletonTable, Slider, SpeakerHeader, StatCard, StatusPill, Switch, TONE_CLASSES, TOOL_CATEGORY_ICONS, TRANSCRIPT_TEXT, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tag, TangleKnot, TaskList, TerminalCursor, TerminalDisplay, TerminalInput, TerminalLine, TextShimmer, Textarea, ThemeToggle, ThinkingIndicator, TimeSelect, ToastContainer, ToastProvider, ToolCallFeed, Toolbar, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, UploadProgress, UserMenu, UserMessage, WebSearchPreview, Wizard, WizardStep, WriteFilePreview, activeSessionsAtom, addMessage, addParts, agentTimelineStepKind, badgeVariants, bumpActiveSessionActivity, buttonVariants, clearChat, cn, codeBlockGrammar, configurePdfViewer, copyText, createAuthFetcher, detectFileFormat, fenceInfo, fieldMessageId, fileExtension, filterFileTree, findUnsupportedOpenUINode, focusField, focusFieldInvalid, focusFieldWithin, focusRing, focusRingInset, formatBytes, formatCalendarDate, formatDuration, formatUptime, getActiveSession, getAllActiveSessions, getAllProjectActivity, getCodeLanguage, getFormatLabel, getSanitizedMarkdownHeadingIdFromRawFragment, getSessionsByActivity, getSessionsForNavbar, getSessionsForProject, getSyntaxLanguage, getToolCategory, getToolDisplayMetadata, getToolErrorText, getTotalRunningSessionCount, hasBackgroundRunningSessions, initialsOf, isStreamingAtom, isViewerMessage, ixControl, ixControlAfter, ixControlSoft, ixField, ixRow, ixSelected, ixTabUnderline, localToday, messagesAtom, normalizeSeries, numericColumns, parseCalendarDate, parseCsv, parseToolEvent, partMapAtom, partitionBySpeaker, periodDelta, plainTextFromMarkdown, registerActiveSession, resetActiveSessions, resolveFilePreviewKind, runStatus, seriesAreaPath, seriesExtent, seriesLinePath, seriesMean, seriesScale, setActiveSessionAttention, setActiveSessionConnection, setActiveSessionError, setActiveSessionRunning, setForegroundActiveSession, showsTaskPriority, statusMeta, tableCsv, taskProgress, taskStatus, timeAgo, toneFor, truncateText, unregisterActiveSession, updateActiveSessionMeta, updatePart, useActiveSession, useActiveSessions, useActiveSessionsState, useApiKey, useAuth, useAutoScroll, useDropdownMenu, useHasBackgroundRunningSessions, useLiveTime, useNavbarSessions, useProjectActivity, useProjectSessions, useRealtimeSession, useRunCollapseState, useRunGroups, useSSEStream, useSdkSession, useSessionsByActivity, useTheme, useToast, useToolCallStream, useTotalRunningSessions, validateOpenUIJsonArtifact, validateOpenUIJsonNode };
@@ -1,4 +1,3 @@
1
- import { cn } from "../lib/utils.js";
2
1
  import { CodeBlock } from "../markdown/code-block.js";
3
2
  import { getToolDisplayMetadata } from "../utils/tool-display.js";
4
3
  import { CommandPreview } from "../tool-previews/command-preview.js";
@@ -9,9 +8,10 @@ import { WebSearchPreview } from "../tool-previews/web-search-preview.js";
9
8
  import { QuestionPreview } from "../tool-previews/question-preview.js";
10
9
  import { DiffPreview } from "../tool-previews/diff-preview.js";
11
10
  import { ExpandableContent } from "./expandable-content.js";
11
+ import { RunStatusIcon } from "./status-meta.js";
12
12
  import { memo } from "react";
13
13
  import { jsx, jsxs } from "react/jsx-runtime";
14
- import { AlertCircle, ArrowLeft, ArrowRight, FileText, Loader2 } from "lucide-react";
14
+ import { ArrowLeft, ArrowRight, FileText } from "lucide-react";
15
15
  // src/run/expanded-tool-detail.tsx
16
16
  const FLUSH_TOGGLE = "mx-3 mb-2";
17
17
  const EXT_LANG = {
@@ -144,7 +144,11 @@ const ExpandedToolDetail = memo(({ part }) => {
144
144
  className: "overflow-hidden rounded-[var(--radius-lg)] border border-[var(--surface-danger-border)]",
145
145
  children: [/* @__PURE__ */ jsxs("div", {
146
146
  className: "flex items-center gap-2 border-b border-[var(--surface-danger-border)] bg-[var(--surface-danger-bg)] px-3 py-2",
147
- children: [/* @__PURE__ */ jsx(AlertCircle, { className: "h-3 w-3 text-[var(--surface-danger-text)]" }), /* @__PURE__ */ jsx("span", {
147
+ children: [/* @__PURE__ */ jsx(RunStatusIcon, {
148
+ status: "failed",
149
+ "aria-hidden": true,
150
+ className: "size-3"
151
+ }), /* @__PURE__ */ jsx("span", {
148
152
  className: "text-xs font-medium uppercase tracking-[0.08em] text-[var(--surface-danger-text)]",
149
153
  children: "Error"
150
154
  })]
@@ -159,7 +163,11 @@ const ExpandedToolDetail = memo(({ part }) => {
159
163
  }),
160
164
  (status === "pending" || status === "running") && /* @__PURE__ */ jsxs("div", {
161
165
  className: "flex items-center gap-2 rounded-[var(--radius-md)] border border-border bg-muted px-3 py-3 text-xs text-muted-foreground",
162
- children: [/* @__PURE__ */ jsx(Loader2, { className: cn("h-3 w-3 animate-spin text-primary") }), "Running…"]
166
+ children: [/* @__PURE__ */ jsx(RunStatusIcon, {
167
+ status: "running",
168
+ "aria-hidden": true,
169
+ className: "size-3"
170
+ }), "Running…"]
163
171
  })
164
172
  ]
165
173
  });
@@ -1,5 +1,6 @@
1
1
  import { cn } from "../lib/utils.js";
2
2
  import { formatDuration } from "../utils/format.js";
3
+ import { RunStatusIcon, statusMeta } from "./status-meta.js";
3
4
  import { InlineToolItem } from "./inline-tool-item.js";
4
5
  import { Markdown } from "../markdown/markdown.js";
5
6
  import { InlineThinkingItem } from "./inline-thinking-item.js";
@@ -8,7 +9,7 @@ import { OpenUIArtifactRenderer } from "../openui/openui-artifact-renderer.js";
8
9
  import { TRANSCRIPT_TEXT } from "../chat/transcript-text.js";
9
10
  import { memo, useMemo } from "react";
10
11
  import { jsx, jsxs } from "react/jsx-runtime";
11
- import { Bot, ChevronDown, ChevronRight, ClipboardList, FileEdit, FileSearch, Globe, Loader2, PencilLine, Search, Settings, Sparkles, Terminal } from "lucide-react";
12
+ import { Bot, ChevronDown, ChevronRight, ClipboardList, FileEdit, FileSearch, Globe, PencilLine, Search, Settings, Terminal } from "lucide-react";
12
13
  import * as Collapsible from "@radix-ui/react-collapsible";
13
14
  // src/run/run-group.tsx
14
15
  /**
@@ -46,7 +47,11 @@ function AssistantShell({ branding, isStreaming, children }) {
46
47
  className: "flex items-center gap-2 px-1 font-medium text-muted-foreground text-xs",
47
48
  children: [/* @__PURE__ */ jsx("span", { children: branding.label }), isStreaming ? /* @__PURE__ */ jsxs("span", {
48
49
  className: "inline-flex items-center gap-1.5",
49
- children: [/* @__PURE__ */ jsx(Loader2, { className: "h-3 w-3 animate-spin" }), "Thinking"]
50
+ children: [/* @__PURE__ */ jsx(RunStatusIcon, {
51
+ status: "running",
52
+ "aria-hidden": true,
53
+ className: "size-3"
54
+ }), "Thinking"]
50
55
  }) : null]
51
56
  }), /* @__PURE__ */ jsx("div", {
52
57
  className: ASSISTANT_SHELL,
@@ -249,7 +254,10 @@ const RunGroup = memo(({ run, partMap, collapsed, onToggle, branding = DEFAULT_B
249
254
  }, key);
250
255
  if (toolPart.state.status === "running") return /* @__PURE__ */ jsxs("div", {
251
256
  className: "flex items-center gap-2 rounded-[var(--radius-lg)] border border-[var(--border-subtle)] bg-[var(--md3-surface-container)] px-4 py-3 text-sm text-muted-foreground",
252
- children: [/* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin text-primary" }), "Building view…"]
257
+ children: [/* @__PURE__ */ jsx(RunStatusIcon, {
258
+ status: "running",
259
+ "aria-hidden": true
260
+ }), "Building view…"]
253
261
  }, key);
254
262
  }
255
263
  if (part.type === "text" && !part.synthetic && part.text.trim()) return /* @__PURE__ */ jsx("div", {
@@ -302,12 +310,13 @@ const RunGroup = memo(({ run, partMap, collapsed, onToggle, branding = DEFAULT_B
302
310
  }) : null,
303
311
  /* @__PURE__ */ jsxs("span", {
304
312
  className: "ml-auto flex shrink-0 items-center gap-1.5",
305
- children: [/* @__PURE__ */ jsx(CategoryBadges, { categories: stats.toolCategories }), isStreaming ? /* @__PURE__ */ jsxs("span", {
306
- className: "inline-flex items-center gap-1 rounded-full border border-[var(--border-accent)] bg-[var(--accent-surface-soft)] px-2 py-px text-[10px] font-semibold uppercase text-[var(--accent-text)]",
307
- children: [/* @__PURE__ */ jsx(Loader2, { className: "h-2.5 w-2.5 animate-spin" }), "Running"]
308
- }) : /* @__PURE__ */ jsxs("span", {
313
+ children: [/* @__PURE__ */ jsx(CategoryBadges, { categories: stats.toolCategories }), /* @__PURE__ */ jsxs("span", {
309
314
  className: "inline-flex items-center gap-1 rounded-full border border-border px-2 py-px text-[10px] font-semibold uppercase text-muted-foreground",
310
- children: [/* @__PURE__ */ jsx(Sparkles, { className: "h-2.5 w-2.5" }), "Done"]
315
+ children: [/* @__PURE__ */ jsx(RunStatusIcon, {
316
+ status: isStreaming ? "running" : "done",
317
+ "aria-hidden": true,
318
+ className: "size-3"
319
+ }), statusMeta(isStreaming ? "running" : "done").label]
311
320
  })]
312
321
  })
313
322
  ]
@@ -346,7 +355,10 @@ const RunGroup = memo(({ run, partMap, collapsed, onToggle, branding = DEFAULT_B
346
355
  });
347
356
  else if (toolPart.state.status === "running") node = /* @__PURE__ */ jsxs("div", {
348
357
  className: "flex items-center gap-3 rounded-[var(--radius-lg)] border border-[var(--border-subtle)] bg-[var(--md3-surface-container)] px-4 py-3 text-sm text-muted-foreground",
349
- children: [/* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin text-primary" }), "Building view…"]
358
+ children: [/* @__PURE__ */ jsx(RunStatusIcon, {
359
+ status: "running",
360
+ "aria-hidden": true
361
+ }), "Building view…"]
350
362
  });
351
363
  }
352
364
  if (node === null) node = /* @__PURE__ */ jsx(InlineToolItem, {
@@ -1,8 +1,9 @@
1
1
  import { focusRing } from "../lib/focus.js";
2
2
  import { cn } from "../lib/utils.js";
3
+ import { RunStatusIcon } from "./status-meta.js";
3
4
  import { useState } from "react";
4
5
  import { jsx, jsxs } from "react/jsx-runtime";
5
- import { ChevronRight, CircleAlert, Loader2 } from "lucide-react";
6
+ import { ChevronRight } from "lucide-react";
6
7
  // src/run/run-phase-list.tsx
7
8
  function PhaseRow({ phase }) {
8
9
  const [open, setOpen] = useState(false);
@@ -28,13 +29,9 @@ function PhaseRow({ phase }) {
28
29
  children: [" · ", phase.summary]
29
30
  })]
30
31
  }),
31
- phase.status === "running" && /* @__PURE__ */ jsx(Loader2, {
32
- "aria-label": "Running",
33
- className: "mt-1 size-4 shrink-0 animate-spin text-muted-foreground"
34
- }),
35
- phase.status === "error" && /* @__PURE__ */ jsx(CircleAlert, {
36
- "aria-label": "Had an error",
37
- className: "mt-1 size-4 shrink-0 text-[var(--surface-danger-text)]"
32
+ phase.status && phase.status !== "done" && /* @__PURE__ */ jsx(RunStatusIcon, {
33
+ status: phase.status,
34
+ className: "mt-1"
38
35
  })
39
36
  ]
40
37
  }), open && /* @__PURE__ */ jsx("div", {
@@ -0,0 +1,25 @@
1
+ import { LucideIcon, LucideProps } from "lucide-react";
2
+ /** The states an agent or a run reports. Every surface names them with `statusMeta`. */
3
+ export type RunStatus = "running" | "waiting" | "needs-you" | "done" | "failed" | "stopped" | "idle" | "unknown";
4
+ export interface StatusMeta {
5
+ /** The one word for the state. A qualifier such as "Shipped" follows Done; it never replaces it. */
6
+ label: string;
7
+ /** The lucide glyph, drawn on the 16px grid at stroke 1.75 (`RunStatusIcon` does both). */
8
+ icon: LucideIcon;
9
+ /** The Brand colour token for the glyph and any bare status text: `color: var(<token>)`. */
10
+ token: `--${string}`;
11
+ }
12
+ /** Any status string as a `RunStatus`; a value nothing names reads as Unknown, never as a guess. */
13
+ export declare function runStatus(status: string): RunStatus;
14
+ /** The label, glyph and colour token for a status, in every surface. */
15
+ export declare function statusMeta(status: RunStatus | (string & {})): StatusMeta;
16
+ export interface RunStatusIconProps extends Omit<LucideProps, "ref"> {
17
+ status: RunStatus | (string & {});
18
+ }
19
+ /**
20
+ * A status glyph on the icon grid, in its token colour and labelled with its
21
+ * word. Pass `aria-hidden` where the label is already printed beside it.
22
+ * Running breathes on `--motion-ambient`, the page's one loop period; the
23
+ * breathe is opacity only, so it is the essential motion reduced motion keeps.
24
+ */
25
+ export declare function RunStatusIcon({ status, className, style, ...props }: RunStatusIconProps): import("react").JSX.Element;
@@ -0,0 +1,105 @@
1
+ import { cn } from "../lib/utils.js";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { CircleCheck, CircleDashed, CircleDot, CircleQuestionMark, CircleStop, CircleX, Hand, Hourglass } from "lucide-react";
4
+ // src/run/status-meta.tsx
5
+ const META = {
6
+ running: {
7
+ label: "Running",
8
+ icon: CircleDot,
9
+ token: "--surface-info-text"
10
+ },
11
+ waiting: {
12
+ label: "Waiting",
13
+ icon: Hourglass,
14
+ token: "--surface-neutral-text"
15
+ },
16
+ "needs-you": {
17
+ label: "Needs you",
18
+ icon: Hand,
19
+ token: "--surface-warning-text"
20
+ },
21
+ done: {
22
+ label: "Done",
23
+ icon: CircleCheck,
24
+ token: "--surface-success-text"
25
+ },
26
+ failed: {
27
+ label: "Failed",
28
+ icon: CircleX,
29
+ token: "--surface-danger-text"
30
+ },
31
+ stopped: {
32
+ label: "Stopped",
33
+ icon: CircleStop,
34
+ token: "--surface-neutral-text"
35
+ },
36
+ idle: {
37
+ label: "Idle",
38
+ icon: CircleDashed,
39
+ token: "--surface-neutral-text"
40
+ },
41
+ unknown: {
42
+ label: "Unknown",
43
+ icon: CircleQuestionMark,
44
+ token: "--surface-neutral-text"
45
+ }
46
+ };
47
+ const ALIASES = {
48
+ active: "running",
49
+ in_progress: "running",
50
+ "in-progress": "running",
51
+ streaming: "running",
52
+ pending: "waiting",
53
+ queued: "waiting",
54
+ blocked: "waiting",
55
+ "attention-needed": "needs-you",
56
+ needs_you: "needs-you",
57
+ needs_input: "needs-you",
58
+ awaiting_input: "needs-you",
59
+ completed: "done",
60
+ complete: "done",
61
+ success: "done",
62
+ succeeded: "done",
63
+ shipped: "done",
64
+ error: "failed",
65
+ errored: "failed",
66
+ cancelled: "stopped",
67
+ canceled: "stopped",
68
+ aborted: "stopped"
69
+ };
70
+ /** Any status string as a `RunStatus`; a value nothing names reads as Unknown, never as a guess. */
71
+ function runStatus(status) {
72
+ const key = status.trim().toLowerCase();
73
+ if (Object.hasOwn(META, key)) return key;
74
+ return Object.hasOwn(ALIASES, key) ? ALIASES[key] : "unknown";
75
+ }
76
+ /** The label, glyph and colour token for a status, in every surface. */
77
+ function statusMeta(status) {
78
+ return META[runStatus(status)];
79
+ }
80
+ /**
81
+ * A status glyph on the icon grid, in its token colour and labelled with its
82
+ * word. Pass `aria-hidden` where the label is already printed beside it.
83
+ * Running breathes on `--motion-ambient`, the page's one loop period; the
84
+ * breathe is opacity only, so it is the essential motion reduced motion keeps.
85
+ */
86
+ function RunStatusIcon({ status, className, style, ...props }) {
87
+ const key = runStatus(status);
88
+ const { label, icon: Icon, token } = META[key];
89
+ const running = key === "running";
90
+ return /* @__PURE__ */ jsx(Icon, {
91
+ role: "img",
92
+ "aria-label": label,
93
+ size: 16,
94
+ strokeWidth: 1.75,
95
+ "data-run-status": key,
96
+ "data-motion": running ? "essential" : void 0,
97
+ className: cn("shrink-0", running && "animate-[tangle-breathe_var(--motion-ambient)_infinite]", className),
98
+ style: {
99
+ color: `var(${token})`,
100
+ ...style
101
+ },
102
+ ...props
103
+ });
104
+ }
105
+ export { RunStatusIcon, runStatus, statusMeta };
package/dist/run.d.ts CHANGED
@@ -9,4 +9,5 @@ import { LiveDuration } from "./run/run-item-primitives.js";
9
9
  import { TaskList, TaskListItem, TaskListProps, TaskStatus, showsTaskPriority, taskProgress, taskStatus } from "./run/task-list.js";
10
10
  import { ApprovalCard, ApprovalCardProps, ApprovalDiffFile, ApprovalDiffSummary, ApprovalPlanStep } from "./run/approval-card.js";
11
11
  import { RunPhase, RunPhaseList } from "./run/run-phase-list.js";
12
- export { ApprovalCard, type ApprovalCardProps, type ApprovalDiffFile, ApprovalDiffSummary, type ApprovalPlanStep, ExpandedToolDetail, type ExpandedToolDetailProps, type FeedSegment, InlineThinkingItem, type InlineThinkingItemProps, InlineToolItem, type InlineToolItemProps, LiveDuration, RunGroup, type RunGroupProps, type RunPhase, RunPhaseList, RunRowShell, type RunRowShellProps, type RunRowStatus, RunRowStatusDot, TaskList, type TaskListItem, type TaskListProps, type TaskStatus, type ToolCallData, ToolCallFeed, type ToolCallFeedProps, type ToolCallStatus, type ToolCallType, parseToolEvent, showsTaskPriority, taskProgress, taskStatus };
12
+ import { RunStatus, RunStatusIcon, RunStatusIconProps, StatusMeta, runStatus, statusMeta } from "./run/status-meta.js";
13
+ export { ApprovalCard, type ApprovalCardProps, type ApprovalDiffFile, ApprovalDiffSummary, type ApprovalPlanStep, ExpandedToolDetail, type ExpandedToolDetailProps, type FeedSegment, InlineThinkingItem, type InlineThinkingItemProps, InlineToolItem, type InlineToolItemProps, LiveDuration, RunGroup, type RunGroupProps, type RunPhase, RunPhaseList, RunRowShell, type RunRowShellProps, type RunRowStatus, RunRowStatusDot, type RunStatus, RunStatusIcon, type RunStatusIconProps, type StatusMeta, TaskList, type TaskListItem, type TaskListProps, type TaskStatus, type ToolCallData, ToolCallFeed, type ToolCallFeedProps, type ToolCallStatus, type ToolCallType, parseToolEvent, runStatus, showsTaskPriority, statusMeta, taskProgress, taskStatus };
package/dist/run.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { RunStatusIcon, runStatus, statusMeta } from "./run/status-meta.js";
1
2
  import { ExpandedToolDetail } from "./run/expanded-tool-detail.js";
2
3
  import { RunRowShell, RunRowStatusDot } from "./run/run-row-shell.js";
3
4
  import { InlineToolItem } from "./run/inline-tool-item.js";
@@ -8,4 +9,4 @@ import { ToolCallFeed, parseToolEvent } from "./run/tool-call-feed.js";
8
9
  import { TaskList, showsTaskPriority, taskProgress, taskStatus } from "./run/task-list.js";
9
10
  import { ApprovalCard, ApprovalDiffSummary } from "./run/approval-card.js";
10
11
  import { RunPhaseList } from "./run/run-phase-list.js";
11
- export { ApprovalCard, ApprovalDiffSummary, ExpandedToolDetail, InlineThinkingItem, InlineToolItem, LiveDuration, RunGroup, RunPhaseList, RunRowShell, RunRowStatusDot, TaskList, ToolCallFeed, parseToolEvent, showsTaskPriority, taskProgress, taskStatus };
12
+ export { ApprovalCard, ApprovalDiffSummary, ExpandedToolDetail, InlineThinkingItem, InlineToolItem, LiveDuration, RunGroup, RunPhaseList, RunRowShell, RunRowStatusDot, RunStatusIcon, TaskList, ToolCallFeed, parseToolEvent, runStatus, showsTaskPriority, statusMeta, taskProgress, taskStatus };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/ui",
3
- "version": "11.48.0",
3
+ "version": "11.49.0",
4
4
  "description": "Generic React UI components for Tangle products — primitives, chat, run, files, editor, markdown.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -166,7 +166,7 @@
166
166
  "peerDependencies": {
167
167
  "@hocuspocus/provider": ">=2.15.0 <5.0.0",
168
168
  "@nanostores/react": ">=0.8.4 <3.0.0",
169
- "@tangle-network/brand": "^1.29.0",
169
+ "@tangle-network/brand": "^1.30.0",
170
170
  "@tiptap/core": ">=3.20.4 <4.0.0",
171
171
  "@tiptap/extension-collaboration": ">=3.20.4 <4.0.0",
172
172
  "@tiptap/extension-collaboration-caret": ">=3.7.0 <4.0.0",
@@ -1,11 +1,5 @@
1
1
  import { memo } from "react";
2
- import {
3
- ArrowRight,
4
- ArrowLeft,
5
- AlertCircle,
6
- Loader2,
7
- FileText,
8
- } from "lucide-react";
2
+ import { ArrowRight, ArrowLeft, FileText } from "lucide-react";
9
3
  import type { ToolPart } from "../types/parts";
10
4
  import { getToolDisplayMetadata } from "../utils/tool-display";
11
5
  import { CommandPreview } from "../tool-previews/command-preview";
@@ -16,8 +10,8 @@ import { GlobResultsPreview } from "../tool-previews/glob-results-preview";
16
10
  import { WebSearchPreview } from "../tool-previews/web-search-preview";
17
11
  import { QuestionPreview } from "../tool-previews/question-preview";
18
12
  import { DiffPreview } from "../tool-previews/diff-preview";
19
- import { cn } from "../lib/utils";
20
13
  import { ExpandableContent } from "./expandable-content";
14
+ import { RunStatusIcon } from "./status-meta";
21
15
 
22
16
  export interface ExpandedToolDetailProps {
23
17
  part: ToolPart;
@@ -169,7 +163,7 @@ export const ExpandedToolDetail = memo(({ part }: ExpandedToolDetailProps) => {
169
163
  {error && (
170
164
  <div className="overflow-hidden rounded-[var(--radius-lg)] border border-[var(--surface-danger-border)]">
171
165
  <div className="flex items-center gap-2 border-b border-[var(--surface-danger-border)] bg-[var(--surface-danger-bg)] px-3 py-2">
172
- <AlertCircle className="h-3 w-3 text-[var(--surface-danger-text)]" />
166
+ <RunStatusIcon status="failed" aria-hidden className="size-3" />
173
167
  <span className="text-xs font-medium uppercase tracking-[0.08em] text-[var(--surface-danger-text)]">
174
168
  Error
175
169
  </span>
@@ -185,7 +179,7 @@ export const ExpandedToolDetail = memo(({ part }: ExpandedToolDetailProps) => {
185
179
  {/* Running state */}
186
180
  {(status === "pending" || status === "running") && (
187
181
  <div className="flex items-center gap-2 rounded-[var(--radius-md)] border border-border bg-muted px-3 py-3 text-xs text-muted-foreground">
188
- <Loader2 className={cn("h-3 w-3 animate-spin text-primary")} />
182
+ <RunStatusIcon status="running" aria-hidden className="size-3" />
189
183
  Running…
190
184
  </div>
191
185
  )}
package/src/run/index.ts CHANGED
@@ -37,3 +37,11 @@ export {
37
37
  type ApprovalPlanStep,
38
38
  } from "./approval-card";
39
39
  export { RunPhaseList, type RunPhase } from "./run-phase-list";
40
+ export {
41
+ RunStatusIcon,
42
+ runStatus,
43
+ statusMeta,
44
+ type RunStatus,
45
+ type RunStatusIconProps,
46
+ type StatusMeta,
47
+ } from "./status-meta";
@@ -2,7 +2,6 @@ import { memo, useMemo, type ComponentType, type ReactNode } from "react";
2
2
  import * as Collapsible from "@radix-ui/react-collapsible";
3
3
  import {
4
4
  Bot,
5
- Loader2,
6
5
  ChevronDown,
7
6
  ChevronRight,
8
7
  Terminal,
@@ -13,7 +12,6 @@ import {
13
12
  Globe,
14
13
  ClipboardList,
15
14
  Settings,
16
- Sparkles,
17
15
  type LucideProps,
18
16
  } from "lucide-react";
19
17
  import { cn } from "../lib/utils";
@@ -24,6 +22,7 @@ import type { AgentBranding } from "../types/branding";
24
22
  import type { CustomToolRenderer } from "../types/tool-display";
25
23
  import { InlineToolItem } from "./inline-tool-item";
26
24
  import { InlineThinkingItem } from "./inline-thinking-item";
25
+ import { RunStatusIcon, statusMeta } from "./status-meta";
27
26
  import { Markdown } from "../markdown/markdown";
28
27
  import { SyntheticText } from "../chat/synthetic-text";
29
28
 
@@ -98,7 +97,7 @@ function AssistantShell({
98
97
  <span>{branding.label}</span>
99
98
  {isStreaming ? (
100
99
  <span className="inline-flex items-center gap-1.5">
101
- <Loader2 className="h-3 w-3 animate-spin" />
100
+ <RunStatusIcon status="running" aria-hidden className="size-3" />
102
101
  Thinking
103
102
  </span>
104
103
  ) : null}
@@ -418,7 +417,7 @@ export const RunGroup = memo(
418
417
  key={key}
419
418
  className="flex items-center gap-2 rounded-[var(--radius-lg)] border border-[var(--border-subtle)] bg-[var(--md3-surface-container)] px-4 py-3 text-sm text-muted-foreground"
420
419
  >
421
- <Loader2 className="h-4 w-4 animate-spin text-primary" />
420
+ <RunStatusIcon status="running" aria-hidden />
422
421
  Building view…
423
422
  </div>
424
423
  );
@@ -484,17 +483,10 @@ export const RunGroup = memo(
484
483
  ) : null}
485
484
  <span className="ml-auto flex shrink-0 items-center gap-1.5">
486
485
  <CategoryBadges categories={stats.toolCategories} />
487
- {isStreaming ? (
488
- <span className="inline-flex items-center gap-1 rounded-full border border-[var(--border-accent)] bg-[var(--accent-surface-soft)] px-2 py-px text-[10px] font-semibold uppercase text-[var(--accent-text)]">
489
- <Loader2 className="h-2.5 w-2.5 animate-spin" />
490
- Running
491
- </span>
492
- ) : (
493
- <span className="inline-flex items-center gap-1 rounded-full border border-border px-2 py-px text-[10px] font-semibold uppercase text-muted-foreground">
494
- <Sparkles className="h-2.5 w-2.5" />
495
- Done
496
- </span>
497
- )}
486
+ <span className="inline-flex items-center gap-1 rounded-full border border-border px-2 py-px text-[10px] font-semibold uppercase text-muted-foreground">
487
+ <RunStatusIcon status={isStreaming ? "running" : "done"} aria-hidden className="size-3" />
488
+ {statusMeta(isStreaming ? "running" : "done").label}
489
+ </span>
498
490
  </span>
499
491
  </button>
500
492
  </Collapsible.Trigger>
@@ -542,7 +534,7 @@ export const RunGroup = memo(
542
534
  } else if (toolPart.state.status === "running") {
543
535
  node = (
544
536
  <div className="flex items-center gap-3 rounded-[var(--radius-lg)] border border-[var(--border-subtle)] bg-[var(--md3-surface-container)] px-4 py-3 text-sm text-muted-foreground">
545
- <Loader2 className="h-4 w-4 animate-spin text-primary" />
537
+ <RunStatusIcon status="running" aria-hidden />
546
538
  Building view…
547
539
  </div>
548
540
  );
@@ -0,0 +1,19 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { RunPhaseList } from "./run-phase-list";
3
+
4
+ const meta: Meta<typeof RunPhaseList> = {
5
+ title: "Run/RunPhaseList",
6
+ component: RunPhaseList,
7
+ parameters: { layout: "padded" },
8
+ };
9
+ export default meta;
10
+
11
+ export const Phases: StoryObj<typeof RunPhaseList> = {
12
+ args: {
13
+ phases: [
14
+ { id: "find", title: "Find the hero source", summary: "Read 12 files · searched 3 times", status: "done", content: <p>12 reads</p> },
15
+ { id: "patch", title: "Patch the layout", summary: "2 edits", status: "error", content: <p>An edit failed</p> },
16
+ { id: "prove", title: "Prove it on a phone", summary: "Running the browser", status: "running", content: <p>Chromium at 390</p> },
17
+ ],
18
+ },
19
+ };
@@ -20,6 +20,14 @@ describe("RunPhaseList", () => {
20
20
  expect(screen.queryByText("step detail")).toBeNull();
21
21
  fireEvent.click(first);
22
22
  expect(screen.getByText("step detail")).toBeInTheDocument();
23
- expect(screen.getByLabelText("Had an error")).toBeInTheDocument();
23
+ expect(screen.getByRole("img", { name: "Failed" }).getAttribute("class")).toMatch(/circle-x/);
24
+ });
25
+
26
+ it("marks a running phase with the breathing status glyph, not a spinner", () => {
27
+ const { container } = render(
28
+ <RunPhaseList phases={[{ id: "a", title: "Prove it", status: "running", content: null }]} />,
29
+ );
30
+ expect(screen.getByRole("img", { name: "Running" }).getAttribute("data-motion")).toBe("essential");
31
+ expect(container.querySelector(".animate-spin")).toBeNull();
24
32
  });
25
33
  });
@@ -1,7 +1,8 @@
1
1
  import { useState, type ReactNode } from "react";
2
- import { ChevronRight, CircleAlert, Loader2 } from "lucide-react";
2
+ import { ChevronRight } from "lucide-react";
3
3
  import { focusRing } from "../lib/focus";
4
4
  import { cn } from "../lib/utils";
5
+ import { RunStatusIcon } from "./status-meta";
5
6
 
6
7
  export interface RunPhase {
7
8
  id: string;
@@ -37,8 +38,7 @@ function PhaseRow({ phase }: { phase: RunPhase }) {
37
38
  <span className="font-medium text-foreground">{phase.title}</span>
38
39
  {phase.summary && <span className="text-muted-foreground"> · {phase.summary}</span>}
39
40
  </span>
40
- {phase.status === "running" && <Loader2 aria-label="Running" className="mt-1 size-4 shrink-0 animate-spin text-muted-foreground" />}
41
- {phase.status === "error" && <CircleAlert aria-label="Had an error" className="mt-1 size-4 shrink-0 text-[var(--surface-danger-text)]" />}
41
+ {phase.status && phase.status !== "done" && <RunStatusIcon status={phase.status} className="mt-1" />}
42
42
  </button>
43
43
  {open && <div id={id} className="mb-2 ml-6 mt-1">{phase.content}</div>}
44
44
  </li>
@@ -0,0 +1,92 @@
1
+ import {
2
+ CircleCheck,
3
+ CircleDashed,
4
+ CircleDot,
5
+ CircleQuestionMark,
6
+ CircleStop,
7
+ CircleX,
8
+ Hand,
9
+ Hourglass,
10
+ type LucideIcon,
11
+ type LucideProps,
12
+ } from "lucide-react";
13
+ import { cn } from "../lib/utils";
14
+
15
+ /** The states an agent or a run reports. Every surface names them with `statusMeta`. */
16
+ export type RunStatus = "running" | "waiting" | "needs-you" | "done" | "failed" | "stopped" | "idle" | "unknown";
17
+
18
+ export interface StatusMeta {
19
+ /** The one word for the state. A qualifier such as "Shipped" follows Done; it never replaces it. */
20
+ label: string;
21
+ /** The lucide glyph, drawn on the 16px grid at stroke 1.75 (`RunStatusIcon` does both). */
22
+ icon: LucideIcon;
23
+ /** The Brand colour token for the glyph and any bare status text: `color: var(<token>)`. */
24
+ token: `--${string}`;
25
+ }
26
+
27
+ // Amber is attention, and only Needs you is attention: waiting on a peer, a
28
+ // stop and an idle agent are neutral. Running takes the info ink that
29
+ // StatusPill's running tone and the run-mix in-flight slice already use, not
30
+ // the accent, so a per-user accent can never make Running read as Done or
31
+ // Failed. Failed is always CircleX; the warning triangle is for warnings.
32
+ const META: Record<RunStatus, StatusMeta> = {
33
+ running: { label: "Running", icon: CircleDot, token: "--surface-info-text" },
34
+ waiting: { label: "Waiting", icon: Hourglass, token: "--surface-neutral-text" },
35
+ "needs-you": { label: "Needs you", icon: Hand, token: "--surface-warning-text" },
36
+ done: { label: "Done", icon: CircleCheck, token: "--surface-success-text" },
37
+ failed: { label: "Failed", icon: CircleX, token: "--surface-danger-text" },
38
+ stopped: { label: "Stopped", icon: CircleStop, token: "--surface-neutral-text" },
39
+ idle: { label: "Idle", icon: CircleDashed, token: "--surface-neutral-text" },
40
+ unknown: { label: "Unknown", icon: CircleQuestionMark, token: "--surface-neutral-text" },
41
+ };
42
+
43
+ // The vocabularies ui and its products already speak, so each maps here once.
44
+ const ALIASES: Record<string, RunStatus> = {
45
+ active: "running", in_progress: "running", "in-progress": "running", streaming: "running",
46
+ pending: "waiting", queued: "waiting", blocked: "waiting",
47
+ "attention-needed": "needs-you", needs_you: "needs-you", needs_input: "needs-you", awaiting_input: "needs-you",
48
+ completed: "done", complete: "done", success: "done", succeeded: "done", shipped: "done",
49
+ error: "failed", errored: "failed",
50
+ cancelled: "stopped", canceled: "stopped", aborted: "stopped",
51
+ };
52
+
53
+ /** Any status string as a `RunStatus`; a value nothing names reads as Unknown, never as a guess. */
54
+ export function runStatus(status: string): RunStatus {
55
+ const key = status.trim().toLowerCase();
56
+ if (Object.hasOwn(META, key)) return key as RunStatus;
57
+ return Object.hasOwn(ALIASES, key) ? ALIASES[key] : "unknown";
58
+ }
59
+
60
+ /** The label, glyph and colour token for a status, in every surface. */
61
+ export function statusMeta(status: RunStatus | (string & {})): StatusMeta {
62
+ return META[runStatus(status)];
63
+ }
64
+
65
+ export interface RunStatusIconProps extends Omit<LucideProps, "ref"> {
66
+ status: RunStatus | (string & {});
67
+ }
68
+
69
+ /**
70
+ * A status glyph on the icon grid, in its token colour and labelled with its
71
+ * word. Pass `aria-hidden` where the label is already printed beside it.
72
+ * Running breathes on `--motion-ambient`, the page's one loop period; the
73
+ * breathe is opacity only, so it is the essential motion reduced motion keeps.
74
+ */
75
+ export function RunStatusIcon({ status, className, style, ...props }: RunStatusIconProps) {
76
+ const key = runStatus(status);
77
+ const { label, icon: Icon, token } = META[key];
78
+ const running = key === "running";
79
+ return (
80
+ <Icon
81
+ role="img"
82
+ aria-label={label}
83
+ size={16}
84
+ strokeWidth={1.75}
85
+ data-run-status={key}
86
+ data-motion={running ? "essential" : undefined}
87
+ className={cn("shrink-0", running && "animate-[tangle-breathe_var(--motion-ambient)_infinite]", className)}
88
+ style={{ color: `var(${token})`, ...style }}
89
+ {...props}
90
+ />
91
+ );
92
+ }