MCPcopy Create free account
hub / github.com/Noumena-Network/code / parseEffortValue

Function parseEffortValue

src/utils/effort.ts:85–101  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

83}
84
85export function parseEffortValue(value: unknown): EffortValue | undefined {
86 if (value === undefined || value === null || value === '') {
87 return undefined
88 }
89 if (typeof value === 'number' && isValidNumericEffort(value)) {
90 return value
91 }
92 const str = String(value).toLowerCase()
93 if (isEffortLevel(str)) {
94 return str
95 }
96 const numericValue = parseInt(str, 10)
97 if (!isNaN(numericValue) && isValidNumericEffort(numericValue)) {
98 return numericValue
99 }
100 return undefined
101}
102
103/**
104 * Numeric values are model-default only and not persisted.

Callers 6

runFunction · 0.85
parseAgentFromMarkdownFunction · 0.85
getEffortEnvOverrideFunction · 0.85
createPluginCommandFunction · 0.85
loadAgentFromFileFunction · 0.85

Calls 2

isValidNumericEffortFunction · 0.85
isEffortLevelFunction · 0.85

Tested by

no test coverage detected