Tool
A tool call the agent makes, from input to output.
Usage
Tool
import { Component, DestroyRef, ViewEncapsulation, inject, signal,} from '@angular/core';import { ScBubble, ScBubbleContent,A Trace line: plain while the tool runs, collapsible once its output arrives — the output in a Code Block.
Anatomy
import { ScTrace, ScTraceLine, ScTraceIcon, ScTraceTitle, ScTraceCollapsible, ScTraceCollapsibleTrigger, ScTraceCollapsiblePanelContent, ScCollapsible, ScCollapsibleTrigger, ScCollapsiblePanel,} from '@semantic-components/ui';import { ScCodeBlock, ScCodeBlockContent } from '@semantic-components/ui/code-block';<div scTrace> <div scCollapsible scTraceCollapsible> <button scCollapsibleTrigger scTraceCollapsibleTrigger> <span scTraceLine> <span scTraceIcon><svg siTerminalIcon></svg></span> <span scTraceTitle>Ran git status --short</span> </span> </button> <div scCollapsiblePanel> <div scTraceCollapsiblePanelContent> <div scCodeBlock size="sm"> <pre scCodeBlockContent wrap class="max-h-64" [code]="output"></pre> </div> </div> </div> </div></div>States
The Trace doesn't read tool calls: map each call's state to a status and a title.
States
M app/api/chat/route.ts M components/chat.tsxCommand timed out after 120 seconds.import { Component, ViewEncapsulation } from '@angular/core';import { ScCollapsible, ScCollapsiblePanel, ScCollapsibleTrigger, ScTrace, ScTraceCollapsible, ScTraceCollapsiblePanelContent, ScTraceCollapsibleTrigger, ScTraceIcon,| Tool call | Line status | Title |
|---|---|---|
| Its input arriving, or waiting | "running" while the chat streams | Running … |
| The same, after the chat stops | "error" | Failed to run … |
| Asking for approval | — | Not a line: an Item outside the Trace, Deny and Approve |
| Answered | "running" if approved, none if not | Running … if approved, Denied … if not |
| Output | none | Ran … |
| Error | "error" | Failed to run … |
| Denied | none | Denied … |
A tool that runs in the browser stays waiting after the chat stops, until you give it its output: treat it as waiting, not failed.
Approval
A pending approval is a question for the person, not a step the agent took, so it sits outside the Trace as an Item with Deny and Approve; once answered, the tool is a line again. See Confirmation.
Examples
Long output in a sheet: the line is the Sheet's trigger.
Output in a sheet
import { Component, ViewEncapsulation } from '@angular/core';import { ScSheet, ScSheetDescription, ScSheetHeader, ScSheetPortal, ScSheetProvider, ScSheetTitle, ScSheetTrigger, ScTrace,RTL
command not found: pnpmimport { 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 and the Code Block.