Spaces:
Running
Running
File size: 666 Bytes
837e3ac | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | 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,
}));
}
|