MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / assistantBlockChars

Function assistantBlockChars

scripts/agent-eval/parse-run.mjs:89–94  ·  view source on GitHub ↗

Characters an assistant content block occupies once it is back in the prompt.

(b)

Source from the content-addressed store, hash-verified

87
88/** Characters an assistant content block occupies once it is back in the prompt. */
89function assistantBlockChars(b) {
90 if (b.type === 'text') return (b.text || '').length;
91 if (b.type === 'thinking') return (b.thinking || '').length;
92 if (b.type === 'tool_use') return JSON.stringify(b.input ?? {}).length + (b.name || '').length;
93 return JSON.stringify(b).length;
94}
95
96/**
97 * Parse one session (its segment files, in order) into tool + occupancy stats.

Callers 1

parseSessionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected