@tangle-network/ui 11.51.14 → 11.51.16

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,3 +1,15 @@
1
+ ## 11.51.16
2
+
3
+ ### Patch Changes
4
+
5
+ - 09798b6: Restore `LiveDuration` and `RunRowStatusDot` in `@tangle-network/ui/run`. @tangle-network/sandbox-ui 7.0.2 imports both, so their removal in 11.51.14 broke consumers in a patch release.
6
+
7
+ ## 11.51.15
8
+
9
+ ### Patch Changes
10
+
11
+ - ab4348b: Restore `isOpen` (`@tangle-network/ui/run`) and `formatCost` and `formatCount` (`@tangle-network/ui/utils`). 11.51.14 removed them as unused, but the Discovery viewer imports them, so the removal broke a public API in a patch release.
12
+
1
13
  ## 11.51.14
2
14
 
3
15
  ### Patch Changes
package/dist/hooks.js CHANGED
@@ -2,8 +2,8 @@ import { useRunGroups } from "./hooks/use-run-groups.js";
2
2
  import { useRunCollapseState } from "./hooks/use-run-collapse-state.js";
3
3
  import { useFollowTail } from "./hooks/use-follow-tail.js";
4
4
  import { useAutoScroll } from "./hooks/use-auto-scroll.js";
5
- import { useDropdownMenu } from "./hooks/use-dropdown-menu.js";
6
5
  import { useLiveTime, useRunNow } from "./hooks/use-live-time.js";
6
+ import { useDropdownMenu } from "./hooks/use-dropdown-menu.js";
7
7
  import { useToolCallStream } from "./hooks/use-tool-call-stream.js";
8
8
  import { createAuthFetcher, useApiKey, useAuth } from "./hooks/use-auth.js";
9
9
  import { RealtimeSessionRegistry, useRealtimeSession } from "./hooks/use-realtime-session.js";
package/dist/index.d.ts CHANGED
@@ -113,14 +113,15 @@ import { FilterField, FilterFieldProps, Toolbar, ToolbarProps } from "./primitiv
113
113
  import { ExpandablePanel, ExpandablePanelProps } from "./primitives/expandable-panel.js";
114
114
  import { Logo, LogoProps, TangleKnot } from "./primitives.js";
115
115
  import { RunGroup, RunGroupProps } from "./run/run-group.js";
116
- import { RunRowShell, RunRowShellProps, RunRowStatus } from "./run/run-row-shell.js";
116
+ import { RunRowShell, RunRowShellProps, RunRowStatus, RunRowStatusDot } from "./run/run-row-shell.js";
117
117
  import { InlineToolItem, InlineToolItemProps } from "./run/inline-tool-item.js";
118
118
  import { InlineThinkingItem, InlineThinkingItemProps } from "./run/inline-thinking-item.js";
119
119
  import { ExpandedToolDetail, ExpandedToolDetailProps } from "./run/expanded-tool-detail.js";
120
+ import { LiveDuration } from "./run/run-item-primitives.js";
120
121
  import { TaskList, TaskListItem, TaskListProps, TaskStatus, showsTaskPriority, taskProgress, taskStatus } from "./run/task-list.js";
121
122
  import { ApprovalCard, ApprovalCardProps, ApprovalDiffFile, ApprovalDiffSummary, ApprovalPlanStep } from "./run/approval-card.js";
122
123
  import { RunPhase, RunPhaseList } from "./run/run-phase-list.js";
123
- import { RunStatus, RunStatusIcon, RunStatusIconProps, StatusMeta, runStatus, statusMeta } from "./run/status-meta.js";
124
+ import { RunStatus, RunStatusIcon, RunStatusIconProps, StatusMeta, isOpen, runStatus, statusMeta } from "./run/status-meta.js";
124
125
  import "./run.js";
125
126
  import { OPENUI_NODE_JSON_SCHEMA, OPENUI_NODE_TYPES } from "./openui/schema-data.js";
126
127
  import { OpenUISchemaIssue, OpenUISchemaValidation, findUnsupportedOpenUINode, validateOpenUIJsonArtifact, validateOpenUIJsonNode } from "./openui-schema.js";
@@ -132,7 +133,7 @@ import "./markdown.js";
132
133
  import { addMessage, addParts, clearChat, isStreamingAtom, messagesAtom, partMapAtom, updatePart } from "./stores/chat-store.js";
133
134
  import "./types.js";
134
135
  import { copyText } from "./utils/copy-text.js";
135
- import { formatAxisDuration, formatBytes, formatClock, formatCompact, formatDuration as formatSpanDuration, formatUtcTime, plainTextFromMarkdown, truncateText } from "./utils/format.js";
136
+ import { formatAxisDuration, formatBytes, formatClock, formatCompact, formatCost, formatCount, formatDuration as formatSpanDuration, formatUtcTime, plainTextFromMarkdown, truncateText } from "./utils/format.js";
136
137
  import { timeAgo } from "./utils/time-ago.js";
137
138
  import { TOOL_CATEGORY_ICONS, getToolCategory, getToolDisplayMetadata, getToolErrorText } from "./utils/tool-display.js";
138
139
  import { cn } from "./lib/utils.js";
@@ -147,4 +148,4 @@ import { QuestionPreview, QuestionPreviewProps } from "./tool-previews/question-
147
148
  import { DiffPreview, DiffPreviewProps } from "./tool-previews/diff-preview.js";
148
149
  import { RedactedDocSegment, RedactedDocument, RedactedDocumentData, RedactedDocumentProps, RevealResult } from "./redaction/redacted-document.js";
149
150
  import "./redaction.js";
150
- export { ActiveProjectActivity, ActiveSessionActivityOptions, ActiveSessionConnectionOptions, ActiveSessionConnectionState, ActiveSessionReconnectState, ActiveSessionRecord, ActiveSessionStatus, ActiveSessionTransportMode, ActiveSessionsState, AgentBranding, AgentStreamEvent, AgentTimeline, type AgentTimelineArtifactItem, AgentTimelineColumn, type AgentTimelineCustomItem, type AgentTimelineFoldItem, 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, type EventStreamHandlers, type EventStreamOpener, type EventStreamSource, ExpandablePanel, type ExpandablePanelProps, 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, 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, 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, SettingsNote, type SettingsNoteProps, 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, foldSummary, formatAxisDuration, formatBytes, formatCalendarDate, formatClock, formatCompact, formatSpanDuration as formatDuration, formatSpanDuration, formatSpanDuration as formatUptime, formatUtcTime, 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, useEventStream, useFollowTail, useHasBackgroundRunningSessions, useLiveTime, useNavbarSessions, useProjectActivity, useProjectSessions, useRealtimeSession, useRunCollapseState, useRunGroups, useRunNow, useSSEStream, useSdkSession, useSessionsByActivity, useTheme, useToast, useToolCallStream, useTotalRunningSessions, validateOpenUIJsonArtifact, validateOpenUIJsonNode };
151
+ export { ActiveProjectActivity, ActiveSessionActivityOptions, ActiveSessionConnectionOptions, ActiveSessionConnectionState, ActiveSessionReconnectState, ActiveSessionRecord, ActiveSessionStatus, ActiveSessionTransportMode, ActiveSessionsState, AgentBranding, AgentStreamEvent, AgentTimeline, type AgentTimelineArtifactItem, AgentTimelineColumn, type AgentTimelineCustomItem, type AgentTimelineFoldItem, 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, type EventStreamHandlers, type EventStreamOpener, type EventStreamSource, ExpandablePanel, type ExpandablePanelProps, 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, SettingsNote, type SettingsNoteProps, 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, foldSummary, formatAxisDuration, formatBytes, formatCalendarDate, formatClock, formatCompact, formatCost, formatCount, formatSpanDuration as formatDuration, formatSpanDuration, formatSpanDuration as formatUptime, formatUtcTime, getActiveSession, getAllActiveSessions, getAllProjectActivity, getCodeLanguage, getFormatLabel, getSanitizedMarkdownHeadingIdFromRawFragment, getSessionsByActivity, getSessionsForNavbar, getSessionsForProject, getSyntaxLanguage, getToolCategory, getToolDisplayMetadata, getToolErrorText, getTotalRunningSessionCount, hasBackgroundRunningSessions, initialsOf, isOpen, 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, useEventStream, useFollowTail, useHasBackgroundRunningSessions, useLiveTime, useNavbarSessions, useProjectActivity, useProjectSessions, useRealtimeSession, useRunCollapseState, useRunGroups, useRunNow, useSSEStream, useSdkSession, useSessionsByActivity, useTheme, useToast, useToolCallStream, useTotalRunningSessions, validateOpenUIJsonArtifact, validateOpenUIJsonNode };
package/dist/index.js CHANGED
@@ -38,7 +38,7 @@ import { EmptyState } from "./primitives/empty-state.js";
38
38
  import { StatCard } from "./primitives/stat-card.js";
39
39
  import { TerminalCursor, TerminalDisplay, TerminalInput, TerminalLine } from "./primitives/terminal-display.js";
40
40
  import { DropZone } from "./primitives/drop-zone.js";
41
- import { formatAxisDuration, formatBytes, formatClock, formatCompact, formatDuration as formatSpanDuration, formatUtcTime, plainTextFromMarkdown, truncateText } from "./utils/format.js";
41
+ import { formatAxisDuration, formatBytes, formatClock, formatCompact, formatCost, formatCount, formatDuration as formatSpanDuration, formatUtcTime, plainTextFromMarkdown, truncateText } from "./utils/format.js";
42
42
  import { UploadProgress } from "./primitives/upload-progress.js";
43
43
  import { SidebarDropZone } from "./primitives/sidebar-drop-zone.js";
44
44
  import { ArtifactPane } from "./primitives/artifact-pane.js";
@@ -81,9 +81,9 @@ import { GlobResultsPreview } from "./tool-previews/glob-results-preview.js";
81
81
  import { WebSearchPreview } from "./tool-previews/web-search-preview.js";
82
82
  import { QuestionPreview } from "./tool-previews/question-preview.js";
83
83
  import { DiffPreview } from "./tool-previews/diff-preview.js";
84
- import { RunStatusIcon, runStatus, statusMeta } from "./run/status-meta.js";
84
+ import { RunStatusIcon, isOpen, runStatus, statusMeta } from "./run/status-meta.js";
85
85
  import { ExpandedToolDetail } from "./run/expanded-tool-detail.js";
86
- import { RunRowShell } from "./run/run-row-shell.js";
86
+ import { RunRowShell, RunRowStatusDot } from "./run/run-row-shell.js";
87
87
  import { InlineToolItem } from "./run/inline-tool-item.js";
88
88
  import { fenceInfo } from "./markdown/code-meta.js";
89
89
  import { numericColumns, tableCsv } from "./markdown/markdown-table.js";
@@ -102,6 +102,8 @@ import { AgentTimeline, AgentTimelineColumn, AgentTimelineStep, agentTimelineSte
102
102
  import { ChatContainer } from "./chat/chat-container.js";
103
103
  import { ChatMessage } from "./chat/chat-message.js";
104
104
  import { SpeakerHeader, partitionBySpeaker } from "./chat/speaker.js";
105
+ import { useLiveTime, useRunNow } from "./hooks/use-live-time.js";
106
+ import { LiveDuration } from "./run/run-item-primitives.js";
105
107
  import { ToolCallFeed, parseToolEvent } from "./run/tool-call-feed.js";
106
108
  import { TaskList, showsTaskPriority, taskProgress, taskStatus } from "./run/task-list.js";
107
109
  import { ApprovalCard, ApprovalDiffSummary } from "./run/approval-card.js";
@@ -119,7 +121,6 @@ import { ApiSchema } from "./markdown/api-schema.js";
119
121
  import { AuthHeader, GitHubLoginButton, UserMenu } from "./auth/auth.js";
120
122
  import { LoginLayout } from "./auth/login-layout.js";
121
123
  import { useDropdownMenu } from "./hooks/use-dropdown-menu.js";
122
- import { useLiveTime, useRunNow } from "./hooks/use-live-time.js";
123
124
  import { useToolCallStream } from "./hooks/use-tool-call-stream.js";
124
125
  import { createAuthFetcher, useApiKey, useAuth } from "./hooks/use-auth.js";
125
126
  import { activeSessionsAtom, bumpActiveSessionActivity, getActiveSession, getAllActiveSessions, getAllProjectActivity, getSessionsByActivity, getSessionsForNavbar, getSessionsForProject, getTotalRunningSessionCount, hasBackgroundRunningSessions, registerActiveSession, resetActiveSessions, setActiveSessionAttention, setActiveSessionConnection, setActiveSessionError, setActiveSessionRunning, setForegroundActiveSession, unregisterActiveSession, updateActiveSessionMeta, useActiveSession, useActiveSessions, useActiveSessionsState, useHasBackgroundRunningSessions, useNavbarSessions, useProjectActivity, useProjectSessions, useSessionsByActivity, useTotalRunningSessions } from "./stores/active-sessions-store.js";
@@ -131,4 +132,4 @@ import { addMessage, addParts, clearChat, isStreamingAtom, messagesAtom, partMap
131
132
  import { copyText } from "./utils/copy-text.js";
132
133
  import { timeAgo } from "./utils/time-ago.js";
133
134
  import { RedactedDocument } from "./redaction/redacted-document.js";
134
- 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, ExpandablePanel, 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, 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, RunStatusIcon, SegmentedControl, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, SeriesSparkline, SettingsList, SettingsListItem, SettingsNote, 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, foldSummary, formatAxisDuration, formatBytes, formatCalendarDate, formatClock, formatCompact, formatSpanDuration as formatDuration, formatSpanDuration, formatSpanDuration as formatUptime, formatUtcTime, 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, useEventStream, useFollowTail, useHasBackgroundRunningSessions, useLiveTime, useNavbarSessions, useProjectActivity, useProjectSessions, useRealtimeSession, useRunCollapseState, useRunGroups, useRunNow, useSSEStream, useSdkSession, useSessionsByActivity, useTheme, useToast, useToolCallStream, useTotalRunningSessions, validateOpenUIJsonArtifact, validateOpenUIJsonNode };
135
+ 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, ExpandablePanel, 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, SettingsNote, 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, foldSummary, formatAxisDuration, formatBytes, formatCalendarDate, formatClock, formatCompact, formatCost, formatCount, formatSpanDuration as formatDuration, formatSpanDuration, formatSpanDuration as formatUptime, formatUtcTime, getActiveSession, getAllActiveSessions, getAllProjectActivity, getCodeLanguage, getFormatLabel, getSanitizedMarkdownHeadingIdFromRawFragment, getSessionsByActivity, getSessionsForNavbar, getSessionsForProject, getSyntaxLanguage, getToolCategory, getToolDisplayMetadata, getToolErrorText, getTotalRunningSessionCount, hasBackgroundRunningSessions, initialsOf, isOpen, 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, useEventStream, useFollowTail, useHasBackgroundRunningSessions, useLiveTime, useNavbarSessions, useProjectActivity, useProjectSessions, useRealtimeSession, useRunCollapseState, useRunGroups, useRunNow, useSSEStream, useSdkSession, useSessionsByActivity, useTheme, useToast, useToolCallStream, useTotalRunningSessions, validateOpenUIJsonArtifact, validateOpenUIJsonNode };
@@ -0,0 +1,3 @@
1
+ export declare function LiveDuration({ startTime }: {
2
+ startTime: number;
3
+ }): import("react").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { formatDuration as formatSpanDuration } from "../utils/format.js";
2
+ import { useLiveTime } from "../hooks/use-live-time.js";
3
+ import { jsx } from "react/jsx-runtime";
4
+ // src/run/run-item-primitives.tsx
5
+ function LiveDuration({ startTime }) {
6
+ const elapsed = useLiveTime(100) - startTime;
7
+ return /* @__PURE__ */ jsx("span", {
8
+ className: "text-xs font-mono text-neutral-400 dark:text-neutral-500 tabular-nums",
9
+ children: formatSpanDuration(elapsed)
10
+ });
11
+ }
12
+ export { LiveDuration };
@@ -1,5 +1,14 @@
1
1
  import { ReactNode } from "react";
2
2
  export type RunRowStatus = "running" | "success" | "error" | "idle";
3
+ /**
4
+ * A red dot for a failed row, for rows composed outside the shell. The shell
5
+ * itself marks a failure on the row's own glyph, beside its name, never at the
6
+ * far edge. Success is silence, and a running row carries its state in the
7
+ * title — a `TextShimmer` sweep.
8
+ */
9
+ export declare function RunRowStatusDot({ status }: {
10
+ status: RunRowStatus;
11
+ }): import("react").JSX.Element | null;
3
12
  export interface RunRowShellProps {
4
13
  /** Semantic lead glyph (14px). At rest it is the row's only ornament; on
5
14
  * hover and while open the expand chevron takes its slot. */
@@ -6,6 +6,19 @@ import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import { ChevronRight } from "lucide-react";
7
7
  import * as Collapsible from "@radix-ui/react-collapsible";
8
8
  // src/run/run-row-shell.tsx
9
+ /**
10
+ * A red dot for a failed row, for rows composed outside the shell. The shell
11
+ * itself marks a failure on the row's own glyph, beside its name, never at the
12
+ * far edge. Success is silence, and a running row carries its state in the
13
+ * title — a `TextShimmer` sweep.
14
+ */
15
+ function RunRowStatusDot({ status }) {
16
+ if (status !== "error") return null;
17
+ return /* @__PURE__ */ jsx("span", {
18
+ "data-run-row-status": "error",
19
+ className: "h-1.5 w-1.5 shrink-0 rounded-full bg-[var(--surface-danger-text)]"
20
+ });
21
+ }
9
22
  const SHAPE_CLASS = {
10
23
  single: "rounded-[var(--radius-lg)]",
11
24
  first: "rounded-t-[var(--radius-lg)] rounded-b-[var(--radius-sm)]",
@@ -97,4 +110,4 @@ function RunRowShell({ icon, title, description, descriptionMono = false, status
97
110
  })
98
111
  });
99
112
  }
100
- export { RunRowShell };
113
+ export { RunRowShell, RunRowStatusDot };
@@ -11,6 +11,8 @@ export interface StatusMeta {
11
11
  }
12
12
  /** Any status string as a `RunStatus`; a value nothing names reads as Unknown, never as a guess. */
13
13
  export declare function runStatus(status: string): RunStatus;
14
+ /** Whether a canonical run state can still advance. */
15
+ export declare const isOpen: (status: RunStatus | (string & {})) => boolean;
14
16
  /** The label, glyph and colour token for a status, in every surface. */
15
17
  export declare function statusMeta(status: RunStatus | (string & {})): StatusMeta;
16
18
  export interface RunStatusIconProps extends Omit<LucideProps, "ref"> {
@@ -78,6 +78,12 @@ function runStatus(status) {
78
78
  if (Object.hasOwn(META, key)) return key;
79
79
  return Object.hasOwn(ALIASES, key) ? ALIASES[key] : "unknown";
80
80
  }
81
+ /** Whether a canonical run state can still advance. */
82
+ const isOpen = (status) => [
83
+ "running",
84
+ "waiting",
85
+ "needs-you"
86
+ ].includes(runStatus(status));
81
87
  /** The label, glyph and colour token for a status, in every surface. */
82
88
  function statusMeta(status) {
83
89
  return META[runStatus(status)];
@@ -107,4 +113,4 @@ function RunStatusIcon({ status, className, style, ...props }) {
107
113
  ...props
108
114
  });
109
115
  }
110
- export { RunStatusIcon, runStatus, statusMeta };
116
+ export { RunStatusIcon, isOpen, runStatus, statusMeta };
package/dist/run.d.ts CHANGED
@@ -1,12 +1,13 @@
1
1
  import { ToolCallStatus, ToolCallType } from "./run/tool-call-step.js";
2
2
  import { FeedSegment, ToolCallData, ToolCallFeed, ToolCallFeedProps, parseToolEvent } from "./run/tool-call-feed.js";
3
3
  import { RunGroup, RunGroupProps } from "./run/run-group.js";
4
- import { RunRowShell, RunRowShellProps, RunRowStatus } from "./run/run-row-shell.js";
4
+ import { RunRowShell, RunRowShellProps, RunRowStatus, RunRowStatusDot } from "./run/run-row-shell.js";
5
5
  import { InlineToolItem, InlineToolItemProps } from "./run/inline-tool-item.js";
6
6
  import { InlineThinkingItem, InlineThinkingItemProps } from "./run/inline-thinking-item.js";
7
7
  import { ExpandedToolDetail, ExpandedToolDetailProps } from "./run/expanded-tool-detail.js";
8
+ import { LiveDuration } from "./run/run-item-primitives.js";
8
9
  import { TaskList, TaskListItem, TaskListProps, TaskStatus, showsTaskPriority, taskProgress, taskStatus } from "./run/task-list.js";
9
10
  import { ApprovalCard, ApprovalCardProps, ApprovalDiffFile, ApprovalDiffSummary, ApprovalPlanStep } from "./run/approval-card.js";
10
11
  import { RunPhase, RunPhaseList } from "./run/run-phase-list.js";
11
- import { RunStatus, RunStatusIcon, RunStatusIconProps, StatusMeta, runStatus, statusMeta } from "./run/status-meta.js";
12
- export { ApprovalCard, type ApprovalCardProps, type ApprovalDiffFile, ApprovalDiffSummary, type ApprovalPlanStep, ExpandedToolDetail, type ExpandedToolDetailProps, type FeedSegment, InlineThinkingItem, type InlineThinkingItemProps, InlineToolItem, type InlineToolItemProps, RunGroup, type RunGroupProps, type RunPhase, RunPhaseList, RunRowShell, type RunRowShellProps, type RunRowStatus, 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 };
12
+ import { RunStatus, RunStatusIcon, RunStatusIconProps, StatusMeta, isOpen, 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, isOpen, parseToolEvent, runStatus, showsTaskPriority, statusMeta, taskProgress, taskStatus };
package/dist/run.js CHANGED
@@ -1,11 +1,12 @@
1
- import { RunStatusIcon, runStatus, statusMeta } from "./run/status-meta.js";
1
+ import { RunStatusIcon, isOpen, runStatus, statusMeta } from "./run/status-meta.js";
2
2
  import { ExpandedToolDetail } from "./run/expanded-tool-detail.js";
3
- import { RunRowShell } from "./run/run-row-shell.js";
3
+ import { RunRowShell, RunRowStatusDot } from "./run/run-row-shell.js";
4
4
  import { InlineToolItem } from "./run/inline-tool-item.js";
5
5
  import { InlineThinkingItem } from "./run/inline-thinking-item.js";
6
6
  import { RunGroup } from "./run/run-group.js";
7
+ import { LiveDuration } from "./run/run-item-primitives.js";
7
8
  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, RunGroup, RunPhaseList, RunRowShell, RunStatusIcon, TaskList, ToolCallFeed, parseToolEvent, runStatus, showsTaskPriority, statusMeta, taskProgress, taskStatus };
12
+ export { ApprovalCard, ApprovalDiffSummary, ExpandedToolDetail, InlineThinkingItem, InlineToolItem, LiveDuration, RunGroup, RunPhaseList, RunRowShell, RunRowStatusDot, RunStatusIcon, TaskList, ToolCallFeed, isOpen, parseToolEvent, runStatus, showsTaskPriority, statusMeta, taskProgress, taskStatus };
@@ -17,6 +17,10 @@ export declare function formatAxisDuration(ms: number): string;
17
17
  export declare const formatCompact: (value: number | null | undefined) => string;
18
18
  /** Span milliseconds, tenths below ten seconds, then seconds/minutes; days stay compact. */
19
19
  export declare function formatSpanDuration(ms: number): string;
20
+ /** $0.12, $0.005, $12.40; never rounds a recorded nonzero cost to $0.00. */
21
+ export declare function formatCost(usd: number): string;
22
+ /** 9.8k, 754.4k, 1.2M with the exact count left to a title. */
23
+ export declare function formatCount(n: number): string;
20
24
  /** Elapsed clock at millisecond precision, so zoomed axis ticks keep distinct labels. */
21
25
  export declare function formatClock(ms: number): string;
22
26
  /** Normalize labels to UTC without rewriting the source timestamp. */
@@ -49,6 +49,17 @@ function formatSpanDuration(ms) {
49
49
  const precision = ms < 1e4 ? 100 : ms < 36e5 ? 1e3 : 6e4;
50
50
  return ms >= 864e5 ? formatAxisDuration(ms) : ms < 1e3 ? `${Math.round(ms)}ms` : formatClock(Math.round(ms / precision) * precision);
51
51
  }
52
+ /** $0.12, $0.005, $12.40; never rounds a recorded nonzero cost to $0.00. */
53
+ function formatCost(usd) {
54
+ if (!Number.isFinite(usd) || usd < 0) return "—";
55
+ if (usd === 0) return "$0.00";
56
+ if (usd < .01) return `$${usd.toPrecision(1)}`;
57
+ return `$${usd.toFixed(2)}`;
58
+ }
59
+ /** 9.8k, 754.4k, 1.2M with the exact count left to a title. */
60
+ function formatCount(n) {
61
+ return !Number.isSafeInteger(n) || n < 0 ? "—" : formatCompact(n);
62
+ }
52
63
  /** Elapsed clock at millisecond precision, so zoomed axis ticks keep distinct labels. */
53
64
  function formatClock(ms) {
54
65
  if (!Number.isFinite(ms) || ms < 0) return "—";
@@ -67,4 +78,4 @@ function formatUtcTime(value, includeDate = false) {
67
78
  const iso = date.toISOString();
68
79
  return `${includeDate ? iso.slice(0, 19).replace("T", " ") : iso.slice(11, 19)} UTC`;
69
80
  }
70
- export { formatAxisDuration, formatBytes, formatClock, formatCompact, formatSpanDuration as formatDuration, formatSpanDuration, formatSpanDuration as formatUptime, formatUtcTime, plainTextFromMarkdown, truncateText };
81
+ export { formatAxisDuration, formatBytes, formatClock, formatCompact, formatCost, formatCount, formatSpanDuration as formatDuration, formatSpanDuration, formatSpanDuration as formatUptime, formatUtcTime, plainTextFromMarkdown, truncateText };
package/dist/utils.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { ixControl, ixControlAfter, ixControlSoft, ixField, ixRow, ixSelected, ixTabUnderline } from "./lib/interaction.js";
2
2
  import { copyText } from "./utils/copy-text.js";
3
- import { formatAxisDuration, formatBytes, formatClock, formatCompact, formatDuration as formatSpanDuration, formatUtcTime, plainTextFromMarkdown, truncateText } from "./utils/format.js";
3
+ import { formatAxisDuration, formatBytes, formatClock, formatCompact, formatCost, formatCount, formatDuration as formatSpanDuration, formatUtcTime, plainTextFromMarkdown, truncateText } from "./utils/format.js";
4
4
  import { timeAgo } from "./utils/time-ago.js";
5
5
  import { TOOL_CATEGORY_ICONS, getToolCategory, getToolDisplayMetadata, getToolErrorText } from "./utils/tool-display.js";
6
6
  import { cn } from "./lib/utils.js";
7
7
  import { focusField, focusFieldInvalid, focusFieldWithin, focusRing, focusRingInset } from "./lib/focus.js";
8
- export { TOOL_CATEGORY_ICONS, cn, copyText, focusField, focusFieldInvalid, focusFieldWithin, focusRing, focusRingInset, formatAxisDuration, formatBytes, formatClock, formatCompact, formatSpanDuration as formatDuration, formatSpanDuration, formatSpanDuration as formatUptime, formatUtcTime, getToolCategory, getToolDisplayMetadata, getToolErrorText, ixControl, ixControlAfter, ixControlSoft, ixField, ixRow, ixSelected, ixTabUnderline, plainTextFromMarkdown, timeAgo, truncateText };
8
+ export { TOOL_CATEGORY_ICONS, cn, copyText, focusField, focusFieldInvalid, focusFieldWithin, focusRing, focusRingInset, formatAxisDuration, formatBytes, formatClock, formatCompact, formatCost, formatCount, formatSpanDuration as formatDuration, formatSpanDuration, formatSpanDuration as formatUptime, formatUtcTime, getToolCategory, getToolDisplayMetadata, getToolErrorText, ixControl, ixControlAfter, ixControlSoft, ixField, ixRow, ixSelected, ixTabUnderline, plainTextFromMarkdown, timeAgo, truncateText };
package/dist/utils.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { ixControl, ixControlAfter, ixControlSoft, ixField, ixRow, ixSelected, ixTabUnderline } from "./lib/interaction.js";
2
2
  import { focusField, focusFieldInvalid, focusFieldWithin, focusRing, focusRingInset } from "./lib/focus.js";
3
3
  import { cn } from "./lib/utils.js";
4
- import { formatAxisDuration, formatBytes, formatClock, formatCompact, formatDuration as formatSpanDuration, formatUtcTime, plainTextFromMarkdown, truncateText } from "./utils/format.js";
4
+ import { formatAxisDuration, formatBytes, formatClock, formatCompact, formatCost, formatCount, formatDuration as formatSpanDuration, formatUtcTime, plainTextFromMarkdown, truncateText } from "./utils/format.js";
5
5
  import { TOOL_CATEGORY_ICONS, getToolCategory, getToolDisplayMetadata, getToolErrorText } from "./utils/tool-display.js";
6
6
  import { copyText } from "./utils/copy-text.js";
7
7
  import { timeAgo } from "./utils/time-ago.js";
8
- export { TOOL_CATEGORY_ICONS, cn, copyText, focusField, focusFieldInvalid, focusFieldWithin, focusRing, focusRingInset, formatAxisDuration, formatBytes, formatClock, formatCompact, formatSpanDuration as formatDuration, formatSpanDuration, formatSpanDuration as formatUptime, formatUtcTime, getToolCategory, getToolDisplayMetadata, getToolErrorText, ixControl, ixControlAfter, ixControlSoft, ixField, ixRow, ixSelected, ixTabUnderline, plainTextFromMarkdown, timeAgo, truncateText };
8
+ export { TOOL_CATEGORY_ICONS, cn, copyText, focusField, focusFieldInvalid, focusFieldWithin, focusRing, focusRingInset, formatAxisDuration, formatBytes, formatClock, formatCompact, formatCost, formatCount, formatSpanDuration as formatDuration, formatSpanDuration, formatSpanDuration as formatUptime, formatUtcTime, getToolCategory, getToolDisplayMetadata, getToolErrorText, ixControl, ixControlAfter, ixControlSoft, ixField, ixRow, ixSelected, ixTabUnderline, plainTextFromMarkdown, timeAgo, truncateText };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/ui",
3
- "version": "11.51.14",
3
+ "version": "11.51.16",
4
4
  "description": "Generic React UI components for Tangle products — primitives, chat, run, files, editor, markdown.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -52,51 +52,6 @@ describe("MetricStrip", () => {
52
52
  expect(screen.getByText("$0.00").className).not.toContain("--surface-danger-text");
53
53
  });
54
54
 
55
- it("retains the default two / sm:four grid", () => {
56
- const { container } = render(<MetricStrip><Metric label="Runs" value={0} /></MetricStrip>);
57
- const dl = container.querySelector("dl")!;
58
- expect(dl.className.split(" ")).toEqual(expect.arrayContaining(["grid-cols-2", "sm:grid-cols-4"]));
59
- expect(dl.className).not.toContain("lg:grid-cols");
60
- });
61
-
62
- it.each([3, 4, 5, 6] as const)("owns the grid and all nonoverlapping row-start guards for %i columns", (columns) => {
63
- const { container } = render(
64
- <MetricStrip columns={columns}>
65
- {Array.from({ length: columns }, (_, i) => <Metric key={i} label={`Metric ${i}`} value={i} />)}
66
- </MetricStrip>,
67
- );
68
- const dl = container.querySelector("dl")!;
69
- expect(dl).not.toHaveAttribute("columns");
70
- expect(dl.className).toContain("max-sm:[&>div:not(:nth-child(2n+1))]:border-l");
71
- if (columns <= 4) {
72
- expect(dl.className).toContain(`sm:grid-cols-${columns}`);
73
- expect(dl.className).toContain(`sm:[&>div:not(:nth-child(${columns}n+1))]:border-l`);
74
- } else {
75
- expect(dl.className).toContain("sm:grid-cols-3");
76
- expect(dl.className).toContain("sm:max-lg:[&>div:not(:nth-child(3n+1))]:border-l");
77
- expect(dl.className).toContain(`lg:grid-cols-${columns}`);
78
- expect(dl.className).toContain(`lg:[&>div:not(:nth-child(${columns}n+1))]:border-l`);
79
- }
80
- expect(dl.className).not.toContain("border-l-0");
81
- for (const item of Array.from(dl.children)) expect(item.className).not.toContain("nth-child");
82
- });
83
-
84
- it("does not give a standalone Metric a strip divider", () => {
85
- const { container } = render(<Metric label="Runs" value={0} />);
86
- expect(container.firstElementChild!.className).not.toContain("border-l");
87
- });
88
-
89
- it("wraps full labels, values and qualifiers without relying on a mouse title", () => {
90
- render(<MetricStrip><Metric label="Very long account label without loss" value="$1,284,003.10" hint="Personal wallet (0x1234abcd5678efgh)" /></MetricStrip>);
91
- for (const text of ["Very long account label without loss", "$1,284,003.10", "Personal wallet (0x1234abcd5678efgh)"]) {
92
- const node = screen.getByText(text);
93
- expect(node.className).toContain("[overflow-wrap:anywhere]");
94
- expect(node.className).not.toContain("truncate");
95
- }
96
- expect(screen.getByText("$1,284,003.10")).toHaveAttribute("title", "$1,284,003.10");
97
- expect(screen.getByText("Personal wallet (0x1234abcd5678efgh)")).toHaveAttribute("title", "Personal wallet (0x1234abcd5678efgh)");
98
- });
99
-
100
55
  it("preserves refs, attributes, caller classes and fragment/conditional DOM order", () => {
101
56
  const strip = React.createRef<HTMLDListElement>();
102
57
  const item = React.createRef<HTMLDivElement>();
@@ -28,31 +28,6 @@ describe("StatusPill", () => {
28
28
  expect(glyph).toHaveAttribute("aria-hidden", "true");
29
29
  });
30
30
 
31
- it.each(TONES)("brings %s's own paired background", (tone) => {
32
- const { container } = render(<StatusPill tone={tone}>Status</StatusPill>);
33
- const pill = container.firstElementChild as HTMLElement;
34
- expect(pill.className).toContain(`bg-[var(--surface-`);
35
- expect(pill.className).toContain("border");
36
- });
37
-
38
- // A tone colour is solved against its own background. `bare` drops that
39
- // background, so the tone may ride on the glyph only — lifting it onto the
40
- // label would put it on whatever plane the caller happens to be on.
41
- it.each(TONES)("keeps %s's tone off the label in bare mode", (tone) => {
42
- const { container } = render(
43
- <StatusPill bare tone={tone}>
44
- Status
45
- </StatusPill>,
46
- );
47
- const pill = container.firstElementChild as HTMLElement;
48
- expect(pill.className).toContain("bg-transparent");
49
- expect(pill.className).not.toContain("bg-[var(--surface-");
50
-
51
- const glyphWrapper = container.querySelector("svg")
52
- ?.parentElement as HTMLElement;
53
- expect(glyphWrapper.className).toContain("text-[var(--surface-");
54
- });
55
-
56
31
  // Guards the reason TONE_TEXT is declared rather than recovered by searching
57
32
  // TONE_SURFACE for a `text-` class: a miss there yields undefined and removes
58
33
  // the tone from the only channel bare mode has left.
@@ -68,22 +43,6 @@ describe("StatusPill", () => {
68
43
  expect(glyphWrapper.className).toMatch(/text-\[var\(--surface-[a-z]+-text\)\]/);
69
44
  });
70
45
 
71
- // `px-2` from the size and `px-0` from bare are the same utility group, so
72
- // which one lands is decided by the class merge rather than by reading order.
73
- // Asserting the resolved class list keeps that a guarantee: a bare pill has to
74
- // sit flush against the text beside it, and silently keeping the size padding
75
- // would space it like a chip that lost only its background.
76
- it.each(["sm", "md"] as const)("drops the %s size padding in bare mode", (size) => {
77
- const { container } = render(
78
- <StatusPill bare size={size} tone="info">
79
- Queued
80
- </StatusPill>,
81
- );
82
- const cls = (container.firstElementChild as HTMLElement).className;
83
- expect(cls).toContain("px-0");
84
- expect(cls).not.toMatch(/(^| )px-2(\.5)?( |$)/);
85
- });
86
-
87
46
  it("gives no two tones the same silhouette", () => {
88
47
  const shapes = TONES.map((tone) => {
89
48
  const { container } = render(<StatusPill tone={tone}>S</StatusPill>);
@@ -91,15 +50,4 @@ describe("StatusPill", () => {
91
50
  });
92
51
  expect(new Set(shapes).size).toBe(shapes.length);
93
52
  });
94
-
95
- it("takes a larger size", () => {
96
- const { container } = render(
97
- <StatusPill size="md" tone="info">
98
- Queued
99
- </StatusPill>,
100
- );
101
- expect((container.firstElementChild as HTMLElement).className).toContain(
102
- "text-sm",
103
- );
104
- });
105
53
  });
package/src/run/index.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export { RunGroup, type RunGroupProps } from "./run-group";
2
2
  export {
3
3
  RunRowShell,
4
+ RunRowStatusDot,
4
5
  type RunRowShellProps,
5
6
  type RunRowStatus,
6
7
  } from "./run-row-shell";
@@ -13,6 +14,7 @@ export {
13
14
  ExpandedToolDetail,
14
15
  type ExpandedToolDetailProps,
15
16
  } from "./expanded-tool-detail";
17
+ export { LiveDuration } from "./run-item-primitives";
16
18
  // ToolCallStep/ToolCallGroup are internal adapters over InlineToolItem (used by
17
19
  // AgentTimeline + ToolCallFeed); only their status/type vocabulary is public
18
20
  // because ToolCallData references it.
@@ -38,6 +40,7 @@ export { RunPhaseList, type RunPhase } from "./run-phase-list";
38
40
  export {
39
41
  RunStatusIcon,
40
42
  runStatus,
43
+ isOpen,
41
44
  statusMeta,
42
45
  type RunStatus,
43
46
  type RunStatusIconProps,
@@ -0,0 +1,12 @@
1
+ import { useLiveTime } from "../hooks/use-live-time";
2
+ import { formatDuration } from "../utils/format";
3
+
4
+ export function LiveDuration({ startTime }: { startTime: number }) {
5
+ const elapsed = useLiveTime(100) - startTime;
6
+
7
+ return (
8
+ <span className="text-xs font-mono text-neutral-400 dark:text-neutral-500 tabular-nums">
9
+ {formatDuration(elapsed)}
10
+ </span>
11
+ );
12
+ }
@@ -7,6 +7,22 @@ import { formatDuration } from "../utils/format";
7
7
 
8
8
  export type RunRowStatus = "running" | "success" | "error" | "idle";
9
9
 
10
+ /**
11
+ * A red dot for a failed row, for rows composed outside the shell. The shell
12
+ * itself marks a failure on the row's own glyph, beside its name, never at the
13
+ * far edge. Success is silence, and a running row carries its state in the
14
+ * title — a `TextShimmer` sweep.
15
+ */
16
+ export function RunRowStatusDot({ status }: { status: RunRowStatus }) {
17
+ if (status !== "error") return null;
18
+ return (
19
+ <span
20
+ data-run-row-status="error"
21
+ className="h-1.5 w-1.5 shrink-0 rounded-full bg-[var(--surface-danger-text)]"
22
+ />
23
+ );
24
+ }
25
+
10
26
  export interface RunRowShellProps {
11
27
  /** Semantic lead glyph (14px). At rest it is the row's only ornament; on
12
28
  * hover and while open the expand chevron takes its slot. */
@@ -57,6 +57,9 @@ export function runStatus(status: string): RunStatus {
57
57
  return Object.hasOwn(ALIASES, key) ? ALIASES[key] : "unknown";
58
58
  }
59
59
 
60
+ /** Whether a canonical run state can still advance. */
61
+ export const isOpen = (status: RunStatus | (string & {})): boolean => ["running", "waiting", "needs-you"].includes(runStatus(status));
62
+
60
63
  /** The label, glyph and colour token for a status, in every surface. */
61
64
  export function statusMeta(status: RunStatus | (string & {})): StatusMeta {
62
65
  return META[runStatus(status)];
@@ -57,6 +57,19 @@ export function formatSpanDuration(ms: number): string {
57
57
  return ms >= 86_400_000 ? formatAxisDuration(ms) : ms < 1000 ? `${Math.round(ms)}ms` : formatClock(Math.round(ms / precision) * precision)
58
58
  }
59
59
 
60
+ /** $0.12, $0.005, $12.40; never rounds a recorded nonzero cost to $0.00. */
61
+ export function formatCost(usd: number): string {
62
+ if (!Number.isFinite(usd) || usd < 0) return '—'
63
+ if (usd === 0) return '$0.00'
64
+ if (usd < 0.01) return `$${usd.toPrecision(1)}`
65
+ return `$${usd.toFixed(2)}`
66
+ }
67
+
68
+ /** 9.8k, 754.4k, 1.2M with the exact count left to a title. */
69
+ export function formatCount(n: number): string {
70
+ return !Number.isSafeInteger(n) || n < 0 ? '—' : formatCompact(n)
71
+ }
72
+
60
73
  /** Elapsed clock at millisecond precision, so zoomed axis ticks keep distinct labels. */
61
74
  export function formatClock(ms: number): string {
62
75
  if (!Number.isFinite(ms) || ms < 0) return '—'