diff --git a/index.ts b/index.ts index 9d11179..f958e86 100644 --- a/index.ts +++ b/index.ts @@ -330,18 +330,21 @@ async function runPlugin(ctx: any, options: any, dataDir: string) { parts.push(`
\nThinking\n\n${step.reasoning}\n\n
`) } - // Tool calls + // Tool calls — all in one spoiler with tool names in summary if (step.tools.length > 0) { + const toolNames = step.tools.map(t => t.name).join(", ") + parts.push(`
\n🔧 ${toolNames}\n\n`) for (const tool of step.tools) { - parts.push(`
\n🔧 ${tool.name}\n\n`) - parts.push(`Args:\n\`\`\`\n${tool.args}\n\`\`\`\n\n`) + parts.push(`${tool.name}\n`) + parts.push(`Args:\n\`\`\`\n${tool.args}\n\`\`\`\n`) if (tool.failed) { - parts.push(`Failed: ${tool.result}\n\n`) + parts.push(`Failed: ${tool.result}\n`) } else { - parts.push(`Result:\n\`\`\`\n${tool.result}\n\`\`\`\n\n`) + parts.push(`Result:\n\`\`\`\n${tool.result}\n\`\`\`\n`) } - parts.push(`
`) + parts.push("\n") } + parts.push(`
`) } // Separator before text