Something went wrong. Try again.
source dump of claude code forked from oppi.li/claude-code
Something went wrong. Try again.
1.1 kB · 42 lines
TypeScript
at main
12345678910111213141516171819202122232425262728293031323334353637383940414243import { EFFORT_HIGH, EFFORT_LOW, EFFORT_MAX, EFFORT_MEDIUM,} from '../constants/figures.js'import { type EffortLevel, type EffortValue, getDisplayedEffortLevel, modelSupportsEffort,} from '../utils/effort.js'
/** * Build the text for the effort-changed notification, e.g. "◐ medium · /effort". * Returns undefined if the model doesn't support effort. */export function getEffortNotificationText( effortValue: EffortValue | undefined, model: string,): string | undefined { if (!modelSupportsEffort(model)) return undefined const level = getDisplayedEffortLevel(model, effortValue) return `${effortLevelToSymbol(level)} ${level} · /effort`}
export function effortLevelToSymbol(level: EffortLevel): string { switch (level) { case 'low': return EFFORT_LOW case 'medium': return EFFORT_MEDIUM case 'high': return EFFORT_HIGH case 'max': return EFFORT_MAX default: // Defensive: level can originate from remote config. If an unknown // value slips through, render the high symbol rather than undefined. return EFFORT_HIGH }}