(events: Array<Record<string, unknown>>, harnessId: string)
| 396 | } |
| 397 | |
| 398 | export function extractOpenADEPlanText(events: Array<Record<string, unknown>>, harnessId: string): string | null { |
| 399 | const rawMessages = events.filter((event) => event.type === "raw_message" && typeof event.message === "object") |
| 400 | if (harnessId === "claude-code") return extractClaudePlanText(rawMessages) |
| 401 | if (harnessId === "codex" || harnessId === "codex-cli") return extractCodexPlanText(rawMessages) |
| 402 | return null |
| 403 | } |
| 404 | |
| 405 | function extractClaudePlanText(rawMessages: Array<Record<string, unknown>>): string | null { |
| 406 | for (let index = rawMessages.length - 1; index >= 0; index--) { |
no test coverage detected