feat: show execute result as separate spoiler after child tools
При наличии инструментов в execute скрипте: 1. Спойлеры для каждого распарсенного инструмента (с args) 2. Отдельный спойлер execute с результатом (после всех детей) 3. Без execute спойлера с args кода
This commit is contained in:
parent
1d4e7e6469
commit
f261e1361c
8
index.ts
8
index.ts
|
|
@ -579,7 +579,7 @@ async function runPlugin(ctx: any, options: any, dataDir: string) {
|
|||
: []
|
||||
|
||||
if (childTools.length > 0) {
|
||||
// Execute has child tool calls — show only the children, skip execute
|
||||
// Execute has child tool calls — show children, then execute result separately
|
||||
for (const child of childTools) {
|
||||
parts.push(`<details>\n<summary>🔧 ${child.name}</summary>\n\n`)
|
||||
parts.push(`<b>Args:</b>\n\`\`\`\n${child.args}\n\`\`\`\n\n`)
|
||||
|
|
@ -590,6 +590,12 @@ async function runPlugin(ctx: any, options: any, dataDir: string) {
|
|||
}
|
||||
parts.push(`</details>`)
|
||||
}
|
||||
// Show execute result as a separate spoiler after all child tools
|
||||
if (executeTool?.result) {
|
||||
parts.push(`<details>\n<summary>🔧 execute</summary>\n\n`)
|
||||
parts.push(`<b>Result:</b>\n\`\`\`\n${executeTool.result}\n\`\`\`\n\n`)
|
||||
parts.push(`</details>`)
|
||||
}
|
||||
} else {
|
||||
// No child tool calls — show tools normally (including execute as-is)
|
||||
for (const tool of step.tools) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue