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

Function getTotalToolTokens

lib/token-utils.ts:131–138  ·  view source on GitHub ↗
(state: SessionState, toolIds: string[])

Source from the content-addressed store, hash-verified

129}
130
131export function getTotalToolTokens(state: SessionState, toolIds: string[]): number {
132 let total = 0
133 for (const id of toolIds) {
134 const entry = state.toolParameters.get(id)
135 total += entry?.tokenCount ?? 0
136 }
137 return total
138}
139
140export function countMessageTextTokens(msg: WithParts): number {
141 const texts: string[] = []

Callers 3

deduplicateFunction · 0.90
purgeErrorsFunction · 0.90
handleSweepCommandFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected