Files
orca/src/cli/worktree-ps-program-status.ts
T
OrcaWinandOrcaWin 9aa208a4ab [comment audit] Shorten remaining CLI root comments (#32273)
* chore: shorten process-host comments

* chore: audit CLI parsing and host-routing comments

* chore: remove stale host-selector restriction comment

* chore: shorten remaining CLI root comments

---------

Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-10-23 08:07:03 -07:00

25 lines
824 B
TypeScript

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}%`
}