Context-window fill after a step, mirroring agent-core ContextMemory.
(u: TokenUsage)
| 182 | |
| 183 | /** Context-window fill after a step, mirroring agent-core ContextMemory. */ |
| 184 | function contextFill(u: TokenUsage): number { |
| 185 | return u.inputCacheRead + u.inputCacheCreation + u.inputOther + u.output; |
| 186 | } |
| 187 | |
| 188 | function firstText(input: readonly unknown[] | undefined): string { |
| 189 | if (!input) return ''; |