(message: WithParts)
| 20 | } |
| 21 | |
| 22 | export const messageHasCompress = (message: WithParts): boolean => { |
| 23 | if (!isMessageWithInfo(message)) { |
| 24 | return false |
| 25 | } |
| 26 | |
| 27 | if (message.info.role !== "assistant") { |
| 28 | return false |
| 29 | } |
| 30 | |
| 31 | const parts = Array.isArray(message.parts) ? message.parts : [] |
| 32 | return parts.some( |
| 33 | (part) => |
| 34 | part.type === "tool" && part.tool === "compress" && part.state?.status === "completed", |
| 35 | ) |
| 36 | } |
| 37 | |
| 38 | export const isIgnoredUserMessage = (message: WithParts): boolean => { |
| 39 | if (!isMessageWithInfo(message)) { |
no test coverage detected