AI
AiAgentStepView
BitAiAgentStepView is one step of an agent run, drawn as an entry of a timeline so the sequence and the current position read at a glance: a marker that says the state (pending, running, blocked, completed, failed, skipped), the title with how long the step took or has been taking, its detail and summary, the tool calls it made - by name and status when the conversation is given - and the error of a failed step. A BitAiAgentRunView renders one per step; on its own it draws any step an application keeps.
Notes
Usage
Every example is live. Open its code to see exactly what produced the component running underneath.
Basic
Statuses
Detail & summary
Tool calls
Disabled
- run_tests
Cascading parameters
Style & Class
RTL
CSS variables
The public custom properties this component reads off its root, for what no parameter covers.
Every variable is read with a fallback and never declared by the component, so it inherits like any other custom property:
set one on :root (or in a [bit-theme] block) to restyle every instance, on any ancestor to restyle the ones inside it,
or on the Style of one instance to restyle it - and any instance nested inside it, which inherits the value too; a parameter changes one alone,
as does the real CSS property on the instance's Style / Styles when that property does not inherit (opacity: 1 keeps
one disabled instance undimmed without undimming a disabled one inside it), while an inherited one such as color or
font-family also reaches the nested instances that do not set it themselves. Leave a variable unset and the component
falls back to the theme token beside it.
BitAiAgentStepView CSS variables
| Name | Default value | Description |
|---|---|---|
| --bit-AiAgentStepView-gap | spacing(1.5) | Room between the marker and the body. |
| --bit-AiAgentStepView-marker-size | var(--bit-siz-icon-md) | Diameter of the timeline marker, which the line to the next step is placed by too. |
| --bit-AiAgentStepView-marker-color | var(--bit-clr-brd-pri) | Ring of a pending or skipped step. |
| --bit-AiAgentStepView-running-color | var(--bit-clr-pri) | Ring and pulse of the running step. |
| --bit-AiAgentStepView-completed-color | var(--bit-clr-suc) | Marker of a completed step. |
| --bit-AiAgentStepView-completed-icon-color | var(--bit-clr-suc-text) | Check mark of a completed step. |
| --bit-AiAgentStepView-failed-color | var(--bit-clr-err) | Marker of a failed step. |
| --bit-AiAgentStepView-blocked-color | var(--bit-clr-wrn) | Marker of a step waiting on the user. |
| --bit-AiAgentStepView-line-color | var(--bit-clr-brd-sec) | Line joining a step to the next one. |
| --bit-AiAgentStepView-title-font-size | var(--bit-tpg-fs-sm) | Size of the title (the rest of the step is sized from it). |
| --bit-AiAgentStepView-text-color | var(--bit-clr-fg-sec) | The detail, the summary and the duration, and the detail of the error of a failed step. |
| --bit-AiAgentStepView-error-color | var(--bit-clr-err-fg) | The error message of a failed step. |
API
Every parameter, public member, sub-class and enum this component exposes.
BitAiAgentStepView parameters
| Name | Type | Default value | Description |
|---|---|---|---|
| Classes | BitAiAgentStepViewClassStyles? | null | Custom CSS classes for different parts of the agent step view. |
| Conversation | BitAiConversation? | null | The conversation the run belongs to, in which the tool calls of the step are looked up (newest message first) to show them by tool name and status: a running call with the dots of a loader, a failed one in the error color. Without it the calls are listed by their identifiers. A BitAiAgentRunView hands down the conversation of its Session. |
| Step | BitAiAgentStep | The step to render (required). The view subscribes to its Changed event and re-renders at most once per render interval as it changes; a tool call changing on its own is drawn with the next change of the step. | |
| Styles | BitAiAgentStepViewClassStyles? | null | Custom CSS styles for different parts of the agent step view. |
BitComponentBase parameters
| Name | Type | Default value | Description |
|---|---|---|---|
| AriaLabel | string? | null | Gets or sets the accessible label for the component, used by assistive technologies. |
| Class | string? | null | Gets or sets the CSS class name(s) to apply to the rendered element. |
| Dir | BitDir? | null | Gets or sets the text directionality for the component's content. |
| Disabled | bool | false | Gets or sets a value indicating whether the component is disabled and cannot respond to user interaction. |
| ForceAnimation | bool | false | Gets or sets a value indicating whether the component's animations play at their full duration even when reduced motion is requested. |
| HtmlAttributes | Dictionary<string, object> | new Dictionary<string, object>() | Captures additional HTML attributes to be applied to the rendered element, in addition to the component's parameters. An attribute written on the component wins over an entry of the same name. |
| Id | string? | null | Gets or sets the unique identifier for the component's root element. |
| Style | string? | null | Gets or sets the CSS style string to apply to the rendered element. |
| TabIndex | string? | null | Gets or sets the tab order index for the component when navigating with the keyboard. |
| Visibility | BitVisibility | BitVisibility.Visible | Gets or sets the visibility state (visible, hidden, or collapsed) of the component. |
BitComponentBase public members
| Name | Type | Default value | Description |
|---|---|---|---|
| UniqueId | Guid | Guid.NewGuid() | Gets the readonly unique identifier for the component's root element, assigned when the component instance is constructed. |
| RootElement | ElementReference | Gets the reference to the root HTML element associated with this component. |
BitAiAgentStepViewClassStyles properties
| Name | Type | Default value | Description |
|---|---|---|---|
| Root | string? | null | Custom CSS classes/styles for the root element of the BitAiAgentStepView. |
| Marker | string? | null | Custom CSS classes/styles for the timeline marker of the BitAiAgentStepView. |
| MarkerIcon | string? | null | Custom CSS classes/styles for the check icon of the marker of a completed BitAiAgentStepView. |
| Body | string? | null | Custom CSS classes/styles for the body (everything beside the marker) of the BitAiAgentStepView. |
| Title | string? | null | Custom CSS classes/styles for the title row (the title and the duration) of the BitAiAgentStepView. |
| Duration | string? | null | Custom CSS classes/styles for the duration (or the time elapsed so far) of the BitAiAgentStepView. |
| Detail | string? | null | Custom CSS classes/styles for the detail of the BitAiAgentStepView. |
| Summary | string? | null | Custom CSS classes/styles for the summary of the BitAiAgentStepView. |
| ToolCalls | string? | null | Custom CSS classes/styles for the list of tool calls of the BitAiAgentStepView. |
| ToolCall | string? | null | Custom CSS classes/styles for each item of the list of tool calls of the BitAiAgentStepView. |
| ToolCallTag | BitTagClassStyles? | null | Custom CSS classes/styles for the BitTag of each tool call of the BitAiAgentStepView. |
| Error | string? | null | Custom CSS classes/styles for the error message of the BitAiAgentStepView. |
| ErrorDetailButton | BitButtonClassStyles? | null | Custom CSS classes/styles for the button (a BitButton) disclosing the detail of the error of a failed BitAiAgentStepView. |
| ErrorDetail | string? | null | Custom CSS classes/styles for the detail of the error of a failed BitAiAgentStepView, shown behind the disclosure. |
BitAiAgentStep properties
One step of an agent run - the unit the user reasons about ("search the docs"), which usually contains one or more tool calls. A run creates its steps from its plan (BitAiAgentRun.SetPlan, GetOrAddStep); an application keeping steps of its own creates one with new BitAiAgentStep(stepId, title). Every change raises Changed.
| Name | Type | Default value | Description |
|---|---|---|---|
| StepId | string | The stable identifier of the step, preserved across plan revisions. | |
| Title | string | What the step does. Set by the constructor and renewed by a plan revision. | |
| Detail | string? | null | An elaboration of the step, shown under its title. |
| Status | BitAiAgentStepStatus | BitAiAgentStepStatus.Pending | Where the step is in its lifecycle: moved by Start, Block and Complete. |
| Summary | string? | null | A short account of what the step produced, given to Complete. |
| Error | BitAiError? | null | The failure, when the step failed: its Message is shown under the step, and its Detail behind a Show details disclosure. |
| StartedAt | DateTimeOffset? | null | When the step started (the first Start). |
| CompletedAt | DateTimeOffset? | null | When the step finished. |
| Duration | TimeSpan? | null | How long the step took, once it has both started and finished; a step completed without being started has none, so the view shows no time for it. |
| ToolCallIds | IReadOnlyList<string> | [] | The identifiers of the tool calls made during this step. |
| Version | int | 0 | Increments on every change, for cheap render checks. |
| Changed | event Action<BitAiAgentStep>? | Raised after the step changes. | |
| Start | void | Start(): marks the step running, and records when it started the first time. | |
| Block | void | Block(): marks the step blocked on the user (a question, an approval). | |
| AddToolCall | void | AddToolCall(string toolCallId): records a tool call made during this step. Recording the same call twice has no effect, and calls reported in parallel are all kept. | |
| Complete | void | Complete(BitAiAgentStepStatus status = Completed, string? summary = null, BitAiError? error = null): marks the step finished - Completed, Failed or Skipped - with what it produced or what it failed with, and records when it finished. |
BitAiAgentStepStatus enum
| Name | Value | Description |
|---|---|---|
| Pending | 0 | Planned but not started. Its marker is an empty ring and its title is dimmed. |
| Running | 1 | Currently executing. Its marker pulses, and the time it has been running shows beside the title. |
| Blocked | 2 | Paused pending human input or approval: a question of its run (BitAiAgentRun.RequestInput) blocks the steps running with it until it is answered. Its marker is drawn in the warning color. |
| Completed | 3 | Finished successfully. Its marker carries a check mark, and the time it took shows beside the title. |
| Failed | 4 | Finished unsuccessfully. Its marker is drawn in the error color, and the message of its error shows under it, with the detail of the error behind a disclosure. |
| Skipped | 5 | Abandoned because the run ended or the plan changed: a run that fails or is cancelled skips every step it did not finish. Drawn like a pending step. |
BitVisibility enum
| Name | Value | Description |
|---|---|---|
| Visible | 0 | The content of the component is visible. |
| Hidden | 1 | The content of the component is hidden, but the space it takes on the page remains (visibility:hidden). |
| Collapsed | 2 | The component is hidden (display:none). |
BitDir enum
| Name | Value | Description |
|---|---|---|
| Ltr | 0 | Ltr (left to right) is to be used for languages that are written from the left to the right (like English). |
| Rtl | 1 | Rtl (right to left) is to be used for languages that are written from the right to the left (like Arabic). |
| Auto | 2 | Auto lets the user agent decide. It uses a basic algorithm as it parses the characters inside the element until it finds a character with a strong directionality, then applies that directionality to the whole element. |
Feedback
Found a mistake, a gap, or something that could be clearer? Every page and every component is one click from its source.