Task
A piece of work the agent is doing, such as finding the project files or updating a page. Each step — a search, a read, an edit — appears under the task when the agent takes it.
Usage
Task
import { Component, DestroyRef, ViewEncapsulation, computed, inject, input, signal,} from '@angular/core';import {A Trace with a collapsible line for each task. Keep the running task open, and close each one once it is done.
Anatomy
import { ScTrace, ScTraceLine, ScTraceIcon, ScTraceTitle, ScTraceCollapsible, ScTraceCollapsibleTrigger, ScTraceCollapsiblePanelContent, ScCollapsible, ScCollapsibleTrigger, ScCollapsiblePanel,} from '@semantic-components/ui';<div scTrace> <div scCollapsible scTraceCollapsible [open]="choice() ?? running()"> <button scCollapsibleTrigger scTraceCollapsibleTrigger> <span scTraceLine [status]="running() ? 'running' : undefined"> <span scTraceTitle>Updating the page metadata</span> </span> </button> <div scCollapsiblePanel> <div scTraceCollapsiblePanelContent> <div scTrace> <span scTraceLine>…</span> </div> </div> </div> </div></div>Task or Plan
Both are a list of steps under a collapsible line; they differ in when the steps are known. Use a Plan when the agent decides the steps before it starts; a Task when they come from the work itself, the next one known only once the last is taken.
| Aspect | Plan | Task |
|---|---|---|
| Steps | Every step, from the start | Each step, once the agent takes it |
| Pending steps | Yes, waiting their turn | None |
| Title | The goal, with progress: "2 of 4 done" | What the agent is doing, then what it did |
| Per reply | One plan | One or more tasks, each closing when it is done |
Status
The task's status comes from its steps. Its title is in the present tense while it runs, in the past tense once it is done: "Updating the page metadata", "Failed to update the page metadata", "Updated the page metadata".
Examples
Steps with icons, a read linking to its file.
RTL
import { Dir } from '@angular/cdk/bidi';import { Component, LOCALE_ID, ViewEncapsulation } from '@angular/core';import { ScCollapsible, ScCollapsiblePanel, ScCollapsibleTrigger, ScTrace, ScTraceCollapsible, ScTraceCollapsiblePanelContent, ScTraceCollapsibleTrigger,API reference
See the Trace.