( data: ContextData, )
| 29 | // -- |
| 30 | |
| 31 | export function generateContextSuggestions( |
| 32 | data: ContextData, |
| 33 | ): ContextSuggestion[] { |
| 34 | const suggestions: ContextSuggestion[] = [] |
| 35 | |
| 36 | checkNearCapacity(data, suggestions) |
| 37 | checkLargeToolResults(data, suggestions) |
| 38 | checkReadResultBloat(data, suggestions) |
| 39 | checkMemoryBloat(data, suggestions) |
| 40 | checkAutoCompactDisabled(data, suggestions) |
| 41 | |
| 42 | // Sort: warnings first, then by savings descending |
| 43 | suggestions.sort((a, b) => { |
| 44 | if (a.severity !== b.severity) { |
| 45 | return a.severity === 'warning' ? -1 : 1 |
| 46 | } |
| 47 | return (b.savingsTokens ?? 0) - (a.savingsTokens ?? 0) |
| 48 | }) |
| 49 | |
| 50 | return suggestions |
| 51 | } |
| 52 | |
| 53 | // -- |
| 54 |
no test coverage detected