Thinking…
{:else if explainError}{explainError}
{:else}{explainText}
{/if}Thinking…
{:else if fixError}{fixError}
{:else if fixResult} {#if !fixResult.suggestedQuery}{fixResult.explanation || "The AI couldn't determine a fix for this error."}
{:else}{query}
{fixResult.suggestedQuery}
{fixResult.explanation}
{/if} {#if fixResult.blocked}⚠ This suggestion isn't offered as directly runnable: {(fixResult.costWarnings ?? []).join('; ')} You can still copy it and adjust manually.
{/if}Thinking…
{:else if optimizeError}{optimizeError}
{:else if optimizeResult}{optimizeResult.phrased || optimizeResult.findings.join('; ')}
{#if optimizeResult.suggestedQuery}{query}
{optimizeResult.suggestedQuery}
Thinking…
{:else if translateError}{translateError}
{:else if translateResult} {#if !translateResult.query}{translateResult.lowConfidenceReason || "Not confident enough to guess -- try rephrasing."}
{:else} {#if translateResult.confidence === 'low'}⚠ Low confidence{translateResult.lowConfidenceReason ? `: ${translateResult.lowConfidenceReason}` : ''}. Review carefully before using.
{/if} {#if !translateResult.compiles}⚠ This doesn't parse as a valid query: {translateResult.compileError}. Edit it above before using.
{/if} {#if translateExplanation}{translateExplanation}
{/if} {#if translateResult.blocked && editedQuery === translateResult.query}⚠ Not offered as directly runnable: {(translateResult.costWarnings ?? []).join('; ')} Edit the query above to address this, or copy it manually.
{/if}