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

Function cycleEffortLevel

src/components/ModelPicker.tsx:431–442  ·  view source on GitHub ↗
(current: EffortLevel, direction: 'left' | 'right', includeMax: boolean)

Source from the content-addressed store, hash-verified

429 return t4;
430}
431function cycleEffortLevel(current: EffortLevel, direction: 'left' | 'right', includeMax: boolean): EffortLevel {
432 const levels: EffortLevel[] = includeMax ? ['low', 'medium', 'high', 'max'] : ['low', 'medium', 'high'];
433 // If the current level isn't in the cycle (e.g. 'max' after switching to a
434 // non-Opus model), clamp to 'high'.
435 const idx = levels.indexOf(current);
436 const currentIndex = idx !== -1 ? idx : levels.indexOf('high');
437 if (direction === 'right') {
438 return levels[(currentIndex + 1) % levels.length]!;
439 } else {
440 return levels[(currentIndex - 1 + levels.length) % levels.length]!;
441 }
442}
443function getDefaultEffortLevelForOption(value?: string): EffortLevel {
444 const resolved = resolveOptionModel(value) ?? getDefaultMainLoopModel();
445 const defaultValue = getDefaultEffortForModel(resolved);

Callers 1

ModelPickerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected