(enable: boolean, setAppState: (f: (prev: AppState) => AppState) => void)
| 14 | import { formatModelPricing, getOpus46CostTier } from '../../utils/modelCost.js'; |
| 15 | import { updateSettingsForSource } from '../../utils/settings/settings.js'; |
| 16 | function applyFastMode(enable: boolean, setAppState: (f: (prev: AppState) => AppState) => void): void { |
| 17 | clearFastModeCooldown(); |
| 18 | updateSettingsForSource('userSettings', { |
| 19 | fastMode: enable ? true : undefined |
| 20 | }); |
| 21 | if (enable) { |
| 22 | setAppState(prev => { |
| 23 | // Only switch model if current model doesn't support fast mode |
| 24 | const needsModelSwitch = !isFastModeSupportedByModel(prev.mainLoopModel); |
| 25 | return { |
| 26 | ...prev, |
| 27 | ...(needsModelSwitch ? { |
| 28 | mainLoopModel: getFastModeModel(), |
| 29 | mainLoopModelForSession: null |
| 30 | } : {}), |
| 31 | fastMode: true |
| 32 | }; |
| 33 | }); |
| 34 | } else { |
| 35 | setAppState(prev => ({ |
| 36 | ...prev, |
| 37 | fastMode: false |
| 38 | })); |
| 39 | } |
| 40 | } |
| 41 | export function FastModePicker(t0) { |
| 42 | const $ = _c(30); |
| 43 | const { |
no test coverage detected