ngx-prompt-kit

Tool Steps

ngx-prompt-kit original — not part of ibelick/prompt-kit

Renders an assistant's tool trace from a { name, input, output }[] array — a chain-of-thought disclosure per step, input and output as code blocks. Pass the same array while streaming and after committing; a null output reads as 'Running …' and flips to 'Ran …' once it arrives.

Examples

Completed steps

Each step has an output, so every trigger reads 'Ran …'. Click a step to expand its input and output.

{ "query": "angular signals" }
3 results found
const total = items.reduce((a, b) => a + b, 0);
return total;
42

Streaming (a step still running)

The last step has a null output, so it reads 'Running …' and omits the output block until it arrives.

{ "query": "weather in Zurich" }
18°C, partly cloudy
{ "maxWords": 40 }

Installation

Add the tool-steps component (and the cn() utility) to your project.

ng generate ngx-prompt-kit:tool-steps

Component API

PkToolSteps

PropTypeDefaultDescription
stepsPkToolStep[]Required. Each: { name, input, output: string | null }.
inputLanguagestring 'javascript' Shiki language for the input code block.
outputLanguagestring 'text' Shiki language for the output code block.
runningLabelstring 'Running' Trigger prefix while a step is running (output is null).
ranLabelstring 'Ran' Trigger prefix once a step has finished.
classstringExtra classes for the wrapper.