Files
orcs-code/src/components/EffortIndicator.ts
did:key:z6MkqDnb7Siv3Cwj7pGJq4T5EsUisECqR8KpnDLwcaZq5TPr d2542c9a62 asdf
Squash the current repository state back into one baseline commit while
preserving the README reframing and repository contents.

Constraint: User explicitly requested a single squashed commit with subject "asdf"
Confidence: high
Scope-risk: broad
Reversibility: clean
Directive: This commit intentionally rewrites published history; coordinate before future force-pushes
Tested: git status clean; local history rewritten to one commit; force-pushed main to origin and instructkr
Not-tested: Fresh clone verification after push
2026-03-31 03:34:03 -07:00

43 lines
1.1 KiB
TypeScript

import {
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
}
}