UNPKG

@measey/mycoder-agent

Version:

Agent module for mycoder - an AI-powered software development assistant

27 lines 834 B
import chalk from 'chalk'; import { TokenTracker } from '../tokens.js'; /** * Enhanced utilities for token tracking and reporting */ export function logTokenUsage(tokenTracker) { console.log(chalk.blueBright(`[Token Usage/Agent] ${tokenTracker.toString()}`)); } /** * Creates a child token tracker for a specific tool call */ export function createToolTokenTracker(toolName, parentTracker) { return new TokenTracker(toolName, parentTracker); } /** * Gets the total token usage for a token tracker and all its children */ export function getTotalTokenUsage(tokenTracker) { return tokenTracker.getTotalUsage(); } /** * Gets the total cost for a token tracker and all its children */ export function getTotalTokenCost(tokenTracker) { return tokenTracker.getTotalCost(); } //# sourceMappingURL=tokenTracking.js.map