65
let shellExit: ISdkShellExit | undefined;
66
for (const sdkContent of sdkContents ?? []) {
68
>
case 'shell_exit': {
69
>
const result: TerminalCommandResult = {
70
>
exitCode: sdkContent.exitCode,
71
>
...(sdkContent.outputPreview !== undefined ? { preview: sdkContent.outputPreview } : {}),
72
>
...(sdkContent.outputTruncated !== undefined ? { truncated: sdkContent.outputTruncated } : {}),
73
>
};
74
>
shellExit = { shellId: sdkContent.shellId, result };
75
>
const terminalIndex = content.findIndex(c => c.type === ToolResultContentType.Terminal);
76
>
if (terminalIndex !== -1) {
77
const terminalBlock = content[terminalIndex] as ToolResultTerminalContent;
78
content[terminalIndex] = { ...terminalBlock, result };
80
content.push({
81
type: ToolResultContentType.Terminal,