MCPcopy Create free account
hub / github.com/tiann/hapi / formatGoalUsage

Function formatGoalUsage

cli/src/codex/codexRemoteLauncher.ts:163–171  ·  view source on GitHub ↗
(goal: ThreadGoal)

Source from the content-addressed store, hash-verified

161}
162
163function formatGoalUsage(goal: ThreadGoal): string {
164 const parts: string[] = [`Goal ${formatGoalStatus(goal.status)}`];
165 if (goal.tokenBudget !== null && goal.tokenBudget !== undefined) {
166 parts.push(`${goal.tokensUsed}/${goal.tokenBudget} tokens`);
167 } else if (goal.tokensUsed > 0) {
168 parts.push(`${goal.tokensUsed} tokens`);
169 }
170 return parts.join(' · ');
171}
172
173function stripAnsi(value: string): string {
174 return value.replace(/\u001b\[[0-9;]*m/g, '');

Callers 1

handleGoalCommandMethod · 0.85

Calls 2

formatGoalStatusFunction · 0.70
pushMethod · 0.45

Tested by

no test coverage detected