(commit: StreamCommit, theme: RunEntryTheme)
| 19 | } |
| 20 | |
| 21 | export function entryLook(commit: StreamCommit, theme: RunEntryTheme): { fg: ColorInput; attrs?: number } { |
| 22 | if (commit.kind === "user") { |
| 23 | return { |
| 24 | fg: theme.user.body, |
| 25 | //attrs: TextAttributes.BOLD, |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | if (entryFailed(commit)) { |
| 30 | return { |
| 31 | fg: theme.error.body, |
| 32 | attrs: TextAttributes.BOLD, |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | if (commit.phase === "final") { |
| 37 | return { |
| 38 | fg: theme.system.body, |
| 39 | attrs: TextAttributes.DIM, |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | if (commit.kind === "tool" && commit.phase === "start") { |
| 44 | return { |
| 45 | fg: theme.tool.start ?? theme.tool.body, |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | if (commit.kind === "assistant") { |
| 50 | return { fg: theme.assistant.body } |
| 51 | } |
| 52 | |
| 53 | if (commit.kind === "reasoning") { |
| 54 | return { |
| 55 | fg: theme.reasoning.body, |
| 56 | attrs: TextAttributes.DIM, |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | if (commit.kind === "error") { |
| 61 | return { |
| 62 | fg: theme.error.body, |
| 63 | attrs: TextAttributes.BOLD, |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | if (commit.kind === "tool") { |
| 68 | return { fg: theme.tool.body } |
| 69 | } |
| 70 | |
| 71 | return { fg: theme.system.body } |
| 72 | } |
| 73 | |
| 74 | export function entryColor(commit: StreamCommit, theme: RunTheme): ColorInput { |
| 75 | if (commit.kind === "assistant") { |
no test coverage detected