Interfaces
ContextWindowBreakdownRow
Properties
ContextWindowCompactionPreview
Properties
| Property | Type |
|---|---|
automaticSavedTokens | number |
compactedTokens | number |
currentTokens | number |
loses | readonly string[] |
manualSavedTokens | number |
rawTokens | number |
retains | readonly string[] |
savedTokens | number |
stats | ContextWindowCompactionStats |
ContextWindowCompactionStats
Properties
| Property | Type |
|---|---|
bytesSaved | number |
compacted | boolean |
compactedChars | number |
messagesCompacted | number |
originalChars | number |
turnsCompacted | number |
ContextWindowMeterProps
Properties
| Property | Type |
|---|---|
buttonClassName? | string |
className? | string |
formatTokens? | (tokens: number) => string |
onOpen? | () => void |
ringClassName? | string |
ringInnerClassName? | string |
snapshot | ContextWindowSnapshot |
tooltipClassName? | string |
ContextWindowPanelProps
Properties
| Property | Type |
|---|---|
className? | string |
formatTokens? | (tokens: number) => string |
onCompactNow? | () => void |
slots? | ClassSlots |
snapshot | ContextWindowSnapshot |
ContextWindowPricing
Properties
| Property | Type |
|---|---|
compacted | ContextWindowPromptCostEstimate |
current | ContextWindowPromptCostEstimate |
savedCostUsd | number |
ContextWindowPromptCostEstimate
Properties
| Property | Type |
|---|---|
cachedPromptUsd? | number |
cacheReadPricePerMillion? | number |
costUsd? | number |
estimated? | boolean |
inputPricePerMillion? | number |
promptUsd? | number |
source? | string |
totalUsd? | number |
ContextWindowRingProps
Properties
| Property | Type |
|---|---|
className? | string |
innerClassName? | string |
size? | number |
snapshot | ContextWindowSnapshot |
style? | CSSProperties |
ContextWindowSnapshot
Properties
| Property | Type |
|---|---|
basis | "estimated-next-send" |
breakdown | readonly ContextWindowBreakdownRow[] |
compaction | ContextWindowCompactionStats |
compactionPreview | ContextWindowCompactionPreview |
limitTokens? | number |
percentFull? | number |
pricing | ContextWindowPricing |
sessionUsage? | SessionTokenUsage |
status | ContextWindowStatus |
toolCount | number |
usedTokens | number |
EmptyStateProps
Properties
FoldProps
@pyric/ui/agents — headless structural components for agentic UIs
(chat surfaces, tool-call drill-ins, streaming state indicators).
Matches the rest of @pyric/ui: zero shipped CSS. Components emit
data-pyric-* attributes and accept className slots. Consumers
bring their own design system (Tailwind, CSS modules, plain CSS)
and attach styling via attribute selectors or class names.
Properties
| Property | Type | Description |
|---|---|---|
bodyClassName? | string | Forwarded to the body wrapper revealed when open. |
children | ReactNode | Revealed when the user expands. |
className? | string | Forwarded to the root <details> element. |
defaultOpen? | boolean | - |
header | ReactNode | Visible summary line, always rendered. |
headerAction? | ReactNode | Optional right-aligned action (e.g. a copy button). Children should stopPropagation so clicks don’t toggle the fold. |
summaryClassName? | string | Forwarded to the <summary> element. |
tone? | FoldTone | Surfaced via [data-pyric-fold-tone] so consumers can tint the summary or border based on semantic context (error / thought). Defaults to normal. |
PulsingDotProps
Properties
| Property | Type | Description |
|---|---|---|
className? | string | Forwarded to the outer wrapper. Consumers attach all visual styling (size, animation, color) via this hook or by selecting on [data-pyric-ui="pulsing-dot"]. |
RequestInputComposition
Properties
| Property | Type |
|---|---|
currentPrompt | number |
history | number |
resentToolResults | number |
system | number |
toolSchemas | number |
RequestUsageTimelineProps
Properties
| Property | Type |
|---|---|
className? | string |
empty? | ReactNode |
formatTokens? | (tokens: number) => string |
onOpenTool? | (messageId: string, callId: string) => void |
requests | readonly SessionRequestUsage[] |
slots? | ClassSlots |
SessionCacheInsight
Properties
| Property | Type |
|---|---|
cachedTokens | number |
explanation | string |
freshTokens | number |
hitRate | number |
knownMinimumTokens? | number |
likelyStablePrefixTokens | number |
meetsKnownMinimum? | boolean |
providerMode | string |
SessionRequestUsage
Properties
| Property | Type |
|---|---|
cachedInputTokens | number |
cacheInsight? | string | SessionCacheInsight |
composition | RequestInputComposition |
costUsd? | number |
emittedToolCalls | readonly SessionToolRef[] |
freshInputTokens | number |
id | string |
inputTokens | number |
iteration | number |
messageCount | number |
modelLabel? | string |
outputTokens | number |
providerId? | string |
providerLabel? | string |
reasoningTokens | number |
requestId | string |
resentToolResults | readonly SessionToolRef[] |
strategy? | string |
strategySource? | string |
tokensTotal | number |
toolNames | readonly string[] |
toolResultMessageCount | number |
toolSchemaNames | readonly string[] |
ts? | number |
turnId | string |
usageSource | "estimate" | "provider" |
visibleOutputTokens | number |
SessionSpendSummaryProps
Properties
| Property | Type |
|---|---|
className? | string |
currentContextTokens? | number |
formatTokens? | (tokens: number) => string |
slots? | ClassSlots |
usage? | SessionTokenUsage |
SessionTokenUsage
Properties
| Property | Type |
|---|---|
averageRequestTokens? | number |
cachedInputTokens | number |
categoryDetails | Record<string, SessionUsageCategoryDetail | undefined> |
costUsdTotal? | number |
inputTokens | number |
outputTokens | number |
reasoningTokens | number |
requestRows | readonly SessionRequestUsage[] |
requests | number |
teachingNotes? | { contextVsSpend: string; estimatedComposition: string; providerUsage: string; } |
teachingNotes.contextVsSpend | string |
teachingNotes.estimatedComposition | string |
teachingNotes.providerUsage | string |
tokensTotal | number |
turnRows | readonly SessionTurnUsage[] |
turns | number |
workMultiplier? | number |
SessionToolRef
Properties
SessionTurnUsage
Properties
SessionUsageCategoryDetail
Properties
| Property | Type |
|---|---|
id? | string |
label | string |
note? | string |
rows? | readonly SessionUsageDetailRow[] |
share? | number |
source? | "mixed" | "unavailable" | "provider-reported" | "estimated-from-traces" |
tokens? | number |
SessionUsageDetailRow
Properties
| Property | Type |
|---|---|
color | string |
description | string |
estimated | boolean |
id | string |
label | string |
source | "provider-reported" | "estimated-from-traces" |
tokens | number |
TokenUsageInlineProps
Properties
| Property | Type |
|---|---|
className? | string |
formatTokens? | (tokens: number) => string |
labelClassName? | string |
usage? | SessionTokenUsage |
valueClassName? | string |
Type Aliases
ContextWindowStatus
type ContextWindowStatus = "unknown" | "low" | "medium" | "high" | "critical";
Structural context-window and token-usage contracts rendered by @pyric/ui/agents.
Structurally assignable from @inbrowser/agent/usage (ContextWindowSnapshot,
SessionRequestUsage, SessionTokenUsage) so callers using @inbrowser/agent
pass snapshots directly without casts, while consumers of @pyric/ui ship
complete .d.ts definitions with zero runtime or peer dependency on @inbrowser/agent.
FoldTone
type FoldTone = "normal" | "error" | "thought";
@pyric/ui/agents — headless structural components for agentic UIs
(chat surfaces, tool-call drill-ins, streaming state indicators).
Matches the rest of @pyric/ui: zero shipped CSS. Components emit
data-pyric-* attributes and accept className slots. Consumers
bring their own design system (Tailwind, CSS modules, plain CSS)
and attach styling via attribute selectors or class names.
Functions
ContextWindowMeter()
function ContextWindowMeter(__namedParameters: ContextWindowMeterProps): Element;
Parameters
| Parameter | Type |
|---|---|
__namedParameters | ContextWindowMeterProps |
Returns
Element
ContextWindowPanel()
function ContextWindowPanel(__namedParameters: ContextWindowPanelProps): Element;
Parameters
| Parameter | Type |
|---|---|
__namedParameters | ContextWindowPanelProps |
Returns
Element
ContextWindowRing()
function ContextWindowRing(__namedParameters: ContextWindowRingProps): Element;
Parameters
| Parameter | Type |
|---|---|
__namedParameters | ContextWindowRingProps |
Returns
Element
EmptyState()
function EmptyState(__namedParameters: EmptyStateProps): Element;
Headless zero-state. Structural only: icon slot, title, optional
body, all wrapped in a flex container marked
[data-pyric-ui="empty-state"]. Consumers attach all visual
styling.
Parameters
| Parameter | Type |
|---|---|
__namedParameters | EmptyStateProps |
Returns
Element
Fold()
function Fold(__namedParameters: FoldProps): Element;
Headless disclosure container — native <details> for keyboard /
a11y. Ships zero visual styling. Consumers style via the three
className slots or by selecting on:
[data-pyric-ui=“fold”] — root <details>
[data-pyric-ui=“fold”][open] — expanded state
[data-pyric-fold-tone=“error”] — error tint
[data-pyric-fold-tone=“thought”] — thought-stream tint
[data-pyric-fold-summary] — clickable summary row
[data-pyric-fold-chevron] — disclosure indicator slot
[data-pyric-fold-body] — revealed body wrapper
Parameters
| Parameter | Type |
|---|---|
__namedParameters | FoldProps |
Returns
Element
PulsingDot()
function PulsingDot(__namedParameters: PulsingDotProps): Element;
Headless “live / streaming” indicator. Ships zero visual styling.
Renders three nested spans so consumers can style ring + core independently:
Animation, color, and size are entirely consumer-defined.
Parameters
| Parameter | Type |
|---|---|
__namedParameters | PulsingDotProps |
Returns
Element
RequestUsageTimeline()
function RequestUsageTimeline(__namedParameters: RequestUsageTimelineProps): Element;
Parameters
| Parameter | Type |
|---|---|
__namedParameters | RequestUsageTimelineProps |
Returns
Element
SessionSpendSummary()
function SessionSpendSummary(__namedParameters: SessionSpendSummaryProps): Element;
Parameters
| Parameter | Type |
|---|---|
__namedParameters | SessionSpendSummaryProps |
Returns
Element
TokenUsageInline()
function TokenUsageInline(__namedParameters: TokenUsageInlineProps): Element;
Parameters
| Parameter | Type |
|---|---|
__namedParameters | TokenUsageInlineProps |
Returns
Element
References
Modal
Re-exports Modal
ModalProps
Re-exports ModalProps