MCPcopy Create free account
hub / github.com/anomalyco/opencode / estimate

Function estimate

packages/core/src/session/compaction.ts:79–79  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

77}
78
79const estimate = (value: unknown) => Token.estimate(JSON.stringify(value))
80
81const truncate = (value: string) =>
82 value.length <= TOOL_OUTPUT_MAX_CHARS ? value : `${value.slice(0, TOOL_OUTPUT_MAX_CHARS)}\n[truncated]`

Callers 1

makeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected