Skip to content

armgit / orca

Public Imported from GitHub
0

Orca is the place for working with a fleet of agents (e.g. Grok Bot, Claude Code). Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.

824 B
Raw Blame
import type { RuntimeWorktreeAgentRow } from '../shared/runtime-types'
import {
  programStatusAttentionLabel,
  resolveProgramStatusPresentation
} from '../shared/program-status/presentation'

/** A block takes precedence over progress. */
export function formatWorktreePsProgramStatus(
  agents: readonly RuntimeWorktreeAgentRow[] | undefined
): string {
  let progress: number | undefined
  for (const agent of agents ?? []) {
    const presentation = resolveProgramStatusPresentation({
      state: agent.state,
      programStatus: agent.programStatus,
      toolName: agent.toolName ?? undefined
    })
    if (presentation.attention) {
      return `  (${programStatusAttentionLabel(presentation.attention)})`
    }
    progress ??= presentation.progress
  }
  return progress === undefined ? '' : `  ${progress}%`
}