defaultLabel static method

String defaultLabel(
  1. AgentRunStatus status,
  2. int steps,
  3. Duration? duration
)

The default steps line.

Implementation

static String defaultLabel(
  AgentRunStatus status,
  int steps,
  Duration? duration,
) {
  final count = steps == 0
      ? ''
      : ' · $steps ${steps == 1 ? 'step' : 'steps'}';

  return switch (status) {
    AgentRunStatus.working => 'Thinking…',
    AgentRunStatus.waiting => 'Waiting for approval$count',
    AgentRunStatus.complete =>
      duration == null || duration <= Duration.zero
          ? 'Thought for a few seconds$count'
          : 'Thought for ${_seconds(duration)}$count',
  };
}