CoDEVX / lib /agent-thinking-log.ts
CodexMacTiger
feat: live package-scoped chat and thinking logs
837e3ac
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,
}));
}