( data: unknown, limit: number = MAX_RESPONSE_CHARS, guidance?: string )
| 28 | * The guidance string tells the LLM what to do to get a smaller response. |
| 29 | */ |
| 30 | export function safeSerialize( |
| 31 | data: unknown, |
| 32 | limit: number = MAX_RESPONSE_CHARS, |
| 33 | guidance?: string |
| 34 | ): string { |
| 35 | const text = compactJson(data) |
| 36 | return truncate(text, limit, guidance) |
| 37 | } |
| 38 | |
| 39 | /** One-line preview of an api.response command payload. */ |
| 40 | function apiResponsePreview(payload: any): string { |
no test coverage detected