effort.ts 440 B

12345678910
  1. import type { PluginHookEffort } from './contracts.js';
  2. const COMPATIBLE_EFFORT_LEVELS = new Set(['low', 'medium', 'high', 'xhigh', 'max']);
  3. /** Project a resolved model effort into Compatible's documented Hook shape. */
  4. export function pluginHookEffort(level: string | undefined): PluginHookEffort | undefined {
  5. return level && COMPATIBLE_EFFORT_LEVELS.has(level)
  6. ? { level: level as PluginHookEffort['level'] }
  7. : undefined;
  8. }