{#if isAsyncSubagentResult}
(asyncExpanded = !asyncExpanded)} >
{$t('chat.asyncSubagentComplete')}
{#if asyncSummary}
{asyncSummary}
{/if} {#if delegationLabel}
{delegationLabel}
{/if}
{#if asyncExpanded}
{content}
{/if}
{:else if edit}
{$t('common.save')}
{$t('common.cancel')}
{$t('chat.send')}
{:else} {#if meta?.files?.length > 0}
{#each meta.files as upload}
{#if upload.type === 'image'}
{:else}
{upload.name || 'File'}
{upload.type === 'file' ? 'File' : upload.type || 'File'}
{/if}
{/each}
{/if}
{#each parsedContent as segment}{#if segment.type === 'text'}{segment.value}{:else}{@const isDir = segment.path.endsWith('/')}{@const cleanPath = isDir ? segment.path.slice(0, -1) : segment.path}
{ e.preventDefault(); if (isDir) { setFileBrowserCwd(cleanPath); setActiveTab('files'); } else { openFileTab(cleanPath); } }} >
{segment.label}
{/if}{/each}
{#if siblingTotal > 1 || onedit}
{#if siblingTotal > 1}
onnavigate?.(-1)} aria-label={$t('chat.prevMessage')} use:tooltip={$t('chat.prevMessage')} >
{siblingIndex + 1}/{siblingTotal}
onnavigate?.(1)} aria-label={$t('chat.nextMessage')} use:tooltip={$t('chat.nextMessage')} >
{/if} {#if onedit}
{/if}
{#if copied}
{:else}
{/if}
{/if} {/if}