Spaces:
Running
Running
| import type { AgentLogEntry } from "./work-package-types"; | |
| function classifyThinkingLine(line: string): AgentLogEntry["title"] { | |
| if (line.startsWith("Resolved scope")) return "Scope resolved"; | |
| if (line.startsWith("Mode:")) return "Mutation policy"; | |
| if (line.startsWith("Using ")) return "Provider selected"; | |
| return "Thinking"; | |
| } | |
| export function buildThinkingLogEntries(args: { | |
| thinkingSummary?: string[]; | |
| }) { | |
| const { thinkingSummary = [] } = args; | |
| return thinkingSummary | |
| .map((line) => line.trim()) | |
| .filter(Boolean) | |
| .map((line) => ({ | |
| title: classifyThinkingLine(line), | |
| detail: line, | |
| level: "info" as const, | |
| })); | |
| } | |