* 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>)
| 169 | * excluding tool_result blocks, sidechain messages, and terminal output. |
| 170 | */ |
| 171 | function countUserPromptsFromEntries(entries: ReadonlyArray<Entry>): number { |
| 172 | const nonSidechain = entries.filter( |
| 173 | entry => |
| 174 | entry.type === 'user' && !('isSidechain' in entry && entry.isSidechain), |
| 175 | ) |
| 176 | return countUserPromptsInMessages(nonSidechain) |
| 177 | } |
| 178 | |
| 179 | /** |
| 180 | * Get full attribution data from the provided AppState's attribution state. |
no test coverage detected