MCPcopy Index your code
hub / github.com/codeaashu/claude-code / countUserPromptsFromEntries

Function countUserPromptsFromEntries

src/utils/attribution.ts:171–177  ·  view source on GitHub ↗

* 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>)

Source from the content-addressed store, hash-verified

169 * excluding tool_result blocks, sidechain messages, and terminal output.
170 */
171function 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.

Callers 1

getTranscriptStatsFunction · 0.85

Calls 1

Tested by

no test coverage detected