ToolBlock
ToolBlock = {
text:string;tone?:Tone;type:"status"; } | {type:"text";value:string; } | {language?:string;text:string;type:"code"; } | {rows:ToolTableRow[];type:"table"; } | {paths:string[];type:"files"; } | {path:string;type:"image"; } | {hex:string;type:"color"; } | {text:string;type:"heading"; } | {rows:object[];type:"codeTable"; } | {ranges:object[];text:string;type:"marked"; } | {detail?:string;text:string;type:"headline"; } | {background:string;foreground:string;type:"specimen"; }
A typed piece of output. The kit draws each kind the same way in every tool. Build
them with status, text (the value helper doubles as the text block),
code, table, files, image, and color.
Union Members
Section titled “Union Members”Type Literal
Section titled “Type Literal”{ text: string; tone?: Tone; type: "status"; }
A headline result: “200 OK · 84 ms”, “No package named “expresss””.
Type Literal
Section titled “Type Literal”{ type: "text"; value: string; }
Plain text, selectable. The same shape as the text() value helper.
Type Literal
Section titled “Type Literal”{ language?: string; text: string; type: "code"; }
Monospaced and copyable, with a language hint.
Type Literal
Section titled “Type Literal”{ rows: ToolTableRow[]; type: "table"; }
Label/value rows.
Type Literal
Section titled “Type Literal”{ paths: string[]; type: "files"; }
Files the tool produced (absolute paths): revealed in Finder or dragged out.
Type Literal
Section titled “Type Literal”{ path: string; type: "image"; }
An image file to show (absolute path): a QR code, a preview.
Type Literal
Section titled “Type Literal”{ hex: string; type: "color"; }
A color swatch: "#7C3AED".
Type Literal
Section titled “Type Literal”{ text: string; type: "heading"; }
A small label naming the blocks below it (“Payload”, “Response headers”).
Type Literal
Section titled “Type Literal”{ rows: object[]; type: "codeTable"; }
Label/value rows whose values are code: monospaced, whitespace kept, each copyable.
Type Literal
Section titled “Type Literal”{ ranges: object[]; text: string; type: "marked"; }
Monospaced text with ranges marked (UTF-16 offsets, as JavaScript strings count).
Type Literal
Section titled “Type Literal”{ detail?: string; text: string; type: "headline"; }
The one answer, large (“16:9”, “7.46 mi”), with a line of detail.
Type Literal
Section titled “Type Literal”{ background: string; foreground: string; type: "specimen"; }
Sample text in foreground on background (hex colors): how a color pair reads.