All blocks
Block
Long-running agent task
An autonomous task that takes a while: thinking-bar at the top while it works, narrated steps in a chain-of-thought, and a tool call that updates as it executes. Stream-controls let you abort or restart.
Live agent run
Input
org: PianoNic
repo: ngx-prompt-kit
minAgeDays: 90
Processing tool call...
Call ID: call_a8c10f3e
@if (state() === 'streaming') {
<pk-thinking-bar
[text]="currentTrigger()"
stopLabel="Stop" [showStop]="true"
(stopped)="stop()"
/>
}
<pk-chain-of-thought>
@for (p of visiblePhases(); track p.trigger; let isLast = $last) {
<pk-chain-of-thought-step [last]="isLast && state() !== 'streaming'">
<pk-chain-of-thought-trigger [leftIcon]="true">
<ng-icon leftIcon hlm size="xs" [name]="p.iconName" />
{{ p.trigger }}
</pk-chain-of-thought-trigger>
<pk-chain-of-thought-content>
<pk-chain-of-thought-item>{{ p.detail }}</pk-chain-of-thought-item>
</pk-chain-of-thought-content>
</pk-chain-of-thought-step>
}
</pk-chain-of-thought>
<pk-tool [toolPart]="currentTool()" [defaultOpen]="true" />
<pk-stream-controls
[state]="state()"
(stop)="stop()"
(regenerate)="start()"
/>
// Component
private readonly phases = [
{ trigger: 'Scanning the repo...', iconName: 'lucideFileSearch', detail: '...' },
{ trigger: 'Building the plan', iconName: 'lucideHammer', detail: '...' },
{ trigger: 'Pushing deletions', iconName: 'lucideRefreshCw', detail: '...' },
];
protected readonly state = signal<StreamControlsState>('idle');
protected readonly phaseIdx = signal(0);
protected readonly visiblePhases = computed(() =>
this.phases.slice(0, this.phaseIdx())
);
protected readonly currentTrigger = computed(
() => this.phases[this.phaseIdx()]?.trigger ?? 'Working…'
);
protected readonly currentTool = computed<ToolPart>(() => ({
type: 'cleanup_stale_branches',
state: this.state() === 'idle' ? 'output-available' : 'input-streaming',
// ...
}));