(messages: string[])
| 488 | } |
| 489 | |
| 490 | function extractTaskFromMessages(messages: string[]): string { |
| 491 | // First user message is usually the task |
| 492 | const first = messages[0] || ""; |
| 493 | |
| 494 | // If it starts with "Implement", "Build", "Fix", etc., use first line |
| 495 | const firstLine = first.split("\n")[0].trim(); |
| 496 | if (firstLine.length > 10 && firstLine.length < 300) { |
| 497 | return firstLine; |
| 498 | } |
| 499 | |
| 500 | // Try to find a task-like sentence |
| 501 | for (const msg of messages) { |
| 502 | const match = msg.match( |
| 503 | /(?:implement|build|fix|create|add|refactor|debug|optimize|update|migrate)\s+(.+?)(?:\.|$)/i |
| 504 | ); |
| 505 | if (match) return match[0].trim().slice(0, 200); |
| 506 | } |
| 507 | |
| 508 | return first.slice(0, 200); |
| 509 | } |
| 510 | |
| 511 | function extractDecisions(messages: string[]): string[] { |
| 512 | const decisions: string[] = []; |
nothing calls this directly
no outgoing calls
no test coverage detected