{#if allowEmbeds && !grouped && embeds && Array.isArray(embeds) && embeds.length > 0}
{attributes.name}
{#each embeds as embed, idx}
{#if typeof embed === 'object' && embed?.type === 'mcp_app'} {#key JSON.stringify(embed)}{/key} {:else if typeof embed === 'string'} {/if}
{/each}
{:else}
{#if isActive}
{:else if isRejected}
{:else if isError}
{:else if isDone}
{:else}
{/if}
{displayLabel || toolName}
{#if editStats && !isRejected && (editStats.additions || editStats.deletions)} {#if editStats.additions}+{editStats.additions}{/if} {#if editStats.deletions}−{editStats.deletions}{/if} {/if}
{#if needsApproval && !isAskUser} {:else}
{#if open} {:else} {/if}
{/if}
{#if open}
{#if view && view.kind !== 'edit'} {@const isTruncated = viewOutput.length > RESULT_PREVIEW_LIMIT && !expandedResult} {#if view.kind === 'command' || viewOutput}
{#if view.kind === 'command'}$ {view.command}{viewOutput ? '\n' : ''}{/if}{isTruncated
									? viewOutput.slice(0, RESULT_PREVIEW_LIMIT)
									: viewOutput}
{/if} {#if isTruncated} {/if} {#if view.kind === 'command' && view.exitCode != null && view.exitCode !== 0}
{$i18n.t('Exit code {{CODE}}', { CODE: view.exitCode })}
{/if} {:else if view?.kind === 'edit'} {#each view.files as file, idx (`${file.path}-${idx}`)} {@const stats = diffStats(file.diff)}
{file.path} {#if stats.additions}+{stats.additions}{/if} {#if stats.deletions}−{stats.deletions}{/if}
{#if file.diff}
{/if}
{/each} {#if isError && result}
{result}
{/if} {:else if args}
{$i18n.t('Input')}
{#if parsedArgs}
{#each Object.entries(parsedArgs) as [key, value]}
{key} {typeof value === 'object' ? JSON.stringify(value) : value}
{/each}
{:else}
{formatJSONString(
											args
										)}
{/if}
{/if} {#if !view && isDone && result}
{$i18n.t('Output')}
{#if typeof parsedResult === 'object' && parsedResult !== null}
{JSON.stringify(
											parsedResult,
											null,
											2
										)}
{:else} {@const resultStr = String(parsedResult)} {@const isTruncated = resultStr.length > RESULT_PREVIEW_LIMIT && !expandedResult}
{isTruncated
											? resultStr.slice(0, RESULT_PREVIEW_LIMIT)
											: resultStr}
{#if isTruncated} {/if} {/if}
{/if}
{/if} {/if} {#if isDone} {#if typeof files === 'object'} {#each files ?? [] as file, idx} {#if typeof file === 'string'} {#if file.startsWith('data:image/')} Image {/if} {:else if typeof file === 'object'} {#if (file.type === 'image' || (file?.content_type ?? '').startsWith('image/')) && file.url} Image {/if} {/if} {/each} {/if} {/if}