MCPcopy Create free account
hub / github.com/clawbot7/cli-gateway / toolStatusLabel

Function toolStatusLabel

src/gateway/bindingRuntime.ts:718–738  ·  view source on GitHub ↗
(stage: ToolUiStage, update: any)

Source from the content-addressed store, hash-verified

716}
717
718function toolStatusLabel(stage: ToolUiStage, update: any): string {
719 if (stage === 'start') return 'started';
720
721 const statusRaw = `${update?.status ?? update?.state ?? update?.outcome ?? ''}`
722 .toLowerCase()
723 .trim();
724
725 if (stage === 'complete') {
726 if (
727 statusRaw.includes('fail') ||
728 statusRaw.includes('error') ||
729 update?.error
730 ) {
731 return 'failed';
732 }
733 if (statusRaw.includes('cancel')) return 'cancelled';
734 return 'completed';
735 }
736
737 return statusRaw || 'running';
738}
739
740function extractToolCallId(update: any): string | null {
741 const candidates = [

Callers 1

buildToolUiEventMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected