* Count non-sidechain user messages in transcript entries. * Used to calculate the number of "steers" (user prompts - 1). * * Counts user messages that contain actual user-typed text, * excluding tool_result blocks, sidechain messages, and terminal output.
(entries: ReadonlyArray<Entry>)
| 155 | * excluding tool_result blocks, sidechain messages, and terminal output. |
| 156 | */ |
| 157 | function countUserPromptsFromEntries(entries: ReadonlyArray<Entry>): number { |
| 158 | const nonSidechain = entries.filter( |
| 159 | entry => |
| 160 | entry.type === 'user' && !('isSidechain' in entry && entry.isSidechain), |
| 161 | ) |
| 162 | return countUserPromptsInMessages(nonSidechain) |
| 163 | } |
| 164 | |
| 165 | /** |
| 166 | * Get full attribution data from the provided AppState's attribution state. |
no test coverage detected