| undefined): ToolRenderResult {
const state = result ? (result.isError ? "error" : "complete") : "inprogress";
// With result: show command + output
if (result && params?.command) {
const output = result.output || "";
const combined = output ? `> ${params.command}\n\n${output}` : `> ${params.command}`;
return {
content: html`
${renderHeader(state, SquareTerminal, i18n("Running command..."))}
`,
isCustom: false,
};
}
// Just params (streaming or waiting)
if (params?.command) {
return {
content: html`
${renderHeader(state, SquareTerminal, i18n("Running command..."))}
${params.command}`}>
`,
isCustom: false,
};
}
// No params yet
return { content: renderHeader(state, SquareTerminal, i18n("Waiting for command...")), isCustom: false };
}
}