mirror of
https://github.com/stablyai/orca.git
synced 2026-10-31 00:57:45 +00:00
* 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>
25 lines
824 B
TypeScript
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}%`
|
|
}
|