MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / countTokensForFiles

Function countTokensForFiles

packages/agent-runtime/src/util/token-counter.ts:34–42  ·  view source on GitHub ↗
(
  files: Record<string, string | null>,
)

Source from the content-addressed store, hash-verified

32}
33
34export function countTokensForFiles(
35 files: Record<string, string | null>,
36): Record<string, number> {
37 const tokenCounts: Record<string, number> = {}
38 for (const [filePath, content] of Object.entries(files)) {
39 tokenCounts[filePath] = content ? countTokens(content) : 0
40 }
41 return tokenCounts
42}

Callers

nothing calls this directly

Calls 1

countTokensFunction · 0.85

Tested by

no test coverage detected