MCPcopy
hub / github.com/codeaashu/claude-code / convertEffortValueToLevel

Function convertEffortValueToLevel

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

Source from the content-addressed store, hash-verified

200}
201
202export function convertEffortValueToLevel(value: EffortValue): EffortLevel {
203 if (typeof value === 'string') {
204 // Runtime guard: value may come from remote config (GrowthBook) where
205 // TypeScript types can't help us. Coerce unknown strings to 'high'
206 // rather than passing them through unchecked.
207 return isEffortLevel(value) ? value : 'high'
208 }
209 if (process.env.USER_TYPE === 'ant' && typeof value === 'number') {
210 if (value <= 50) return 'low'
211 if (value <= 85) return 'medium'
212 if (value <= 100) return 'high'
213 return 'max'
214 }
215 return 'high'
216}
217
218/**
219 * Get user-facing description for effort levels

Callers 5

EffortCalloutFunction · 0.85
ModelPickerFunction · 0.85
getDisplayedEffortLevelFunction · 0.85
getEffortSuffixFunction · 0.85

Calls 1

isEffortLevelFunction · 0.85

Tested by

no test coverage detected