MCPcopy Index your code
hub / github.com/Opencode-DCP/opencode-dynamic-context-pruning / estimateTokensBatch

Function estimateTokensBatch

lib/token-utils.ts:78–81  ·  view source on GitHub ↗
(texts: string[])

Source from the content-addressed store, hash-verified

76}
77
78export function estimateTokensBatch(texts: string[]): number {
79 if (texts.length === 0) return 0
80 return countTokens(texts.join(" "))
81}
82
83export const COMPACTED_TOOL_OUTPUT_PLACEHOLDER = "[Old tool result content cleared]"
84

Callers 4

assertCountedFunction · 0.90
countToolTokensFunction · 0.85
countMessageTextTokensFunction · 0.85
countAllMessageTokensFunction · 0.85

Calls 1

countTokensFunction · 0.85

Tested by 1

assertCountedFunction · 0.72