chore: release v1.118.0

This commit is contained in:
Jim Liu 宝玉
2026-05-21 16:56:17 -05:00
parent 6026b619f0
commit adbfa3036b
8 changed files with 84 additions and 51 deletions
-17
View File
@@ -62,20 +62,3 @@ function deriveToolName(item: any): string {
export function hasImageGenInvocation(toolCalls: ToolCall[]): boolean {
return toolCalls.some((tc) => tc.tool === "image_gen");
}
export function parseFinalJson(agentMessage: string | null): { path?: string; bytes?: number } | null {
if (!agentMessage) return null;
const trimmed = agentMessage.trim();
const candidates = [trimmed];
const match = trimmed.match(/\{[^{}]*"status"\s*:\s*"ok"[^{}]*\}/);
if (match) candidates.push(match[0]);
for (const c of candidates) {
try {
const obj = JSON.parse(c);
if (obj?.status === "ok") return { path: obj.path, bytes: obj.bytes };
} catch {
continue;
}
}
return null;
}