(message: WithParts)
| 36 | } |
| 37 | |
| 38 | export const isIgnoredUserMessage = (message: WithParts): boolean => { |
| 39 | if (!isMessageWithInfo(message)) { |
| 40 | return false |
| 41 | } |
| 42 | |
| 43 | if (message.info.role !== "user") { |
| 44 | return false |
| 45 | } |
| 46 | |
| 47 | const parts = Array.isArray(message.parts) ? message.parts : [] |
| 48 | if (parts.length === 0) { |
| 49 | return true |
| 50 | } |
| 51 | |
| 52 | for (const part of parts) { |
| 53 | if (!(part as any).ignored) { |
| 54 | return false |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | return true |
| 59 | } |
| 60 | |
| 61 | export function isProtectedUserMessage(config: PluginConfig, message: WithParts): boolean { |
| 62 | if (!isMessageWithInfo(message)) { |
no test coverage detected