MCPcopy Create free account
hub / github.com/claude-code-best/claude-code / convertEffortValueToLevel

Function convertEffortValueToLevel

src/utils/effort.ts:238–252  ·  view source on GitHub ↗
(value: EffortValue)

Source from the content-addressed store, hash-verified

236}
237
238export function convertEffortValueToLevel(value: EffortValue): EffortLevel {
239 if (typeof value === 'string') {
240 // Runtime guard: value may come from remote config (GrowthBook) where
241 // TypeScript types can't help us. Coerce unknown strings to 'high'
242 // rather than passing them through unchecked.
243 return isEffortLevel(value) ? value : 'high'
244 }
245 if (process.env.USER_TYPE === 'ant' && typeof value === 'number') {
246 if (value <= 50) return 'low'
247 if (value <= 85) return 'medium'
248 if (value <= 100) return 'high'
249 return 'max'
250 }
251 return 'high'
252}
253
254/**
255 * Get user-facing description for effort levels

Callers 6

EffortCalloutFunction · 0.85
ModelPickerFunction · 0.85
getDisplayedEffortLevelFunction · 0.85
getEffortSuffixFunction · 0.85
effort.test.tsFile · 0.85

Calls 1

isEffortLevelFunction · 0.85

Tested by

no test coverage detected