(mode: MemoryMode | undefined, contextWindow: number | undefined, threshold = AUTO_LIGHTWEIGHT_BELOW)
| 29 | * small window (where every-fact injection would crowd out the task) and full on a roomy one. PURE. |
| 30 | */ |
| 31 | export function resolveMemoryMode(mode: MemoryMode | undefined, contextWindow: number | undefined, threshold = AUTO_LIGHTWEIGHT_BELOW): 'full' | 'lightweight' { |
| 32 | if (mode === 'lightweight') return 'lightweight'; |
| 33 | if (mode === 'auto') return (contextWindow != null && contextWindow <= threshold) ? 'lightweight' : 'full'; |
| 34 | return 'full'; |
| 35 | } |
| 36 | |
| 37 | /** A fact is "important" (always injected) if it carries the `!important` marker (case-insensitive). */ |
| 38 | export function isImportantFact(fact: string): boolean { |
no outgoing calls
no test coverage detected