(messages: Message[])
| 4 | import { registerBundledSkill } from '../bundledSkills.js' |
| 5 | |
| 6 | function extractUserMessages(messages: Message[]): string[] { |
| 7 | return messages |
| 8 | .filter((m): m is Extract<typeof m, { type: 'user' }> => m.type === 'user') |
| 9 | .map(m => { |
| 10 | const content = m.message.content |
| 11 | if (typeof content === 'string') return content |
| 12 | return content |
| 13 | .filter( |
| 14 | (b): b is Extract<typeof b, { type: 'text' }> => b.type === 'text', |
| 15 | ) |
| 16 | .map(b => b.text) |
| 17 | .join('\n') |
| 18 | }) |
| 19 | .filter(text => text.trim().length > 0) |
| 20 | } |
| 21 | |
| 22 | const SKILLIFY_PROMPT = `# Skillify {{userDescriptionBlock}} |
| 23 |
no outgoing calls
no test coverage detected