539
}
540
if (params.item.type === 'fileChange') {
542
>
const output = fileChangeOutput(params.item.changes);
543
>
state.itemToToolCall.set(params.item.id, {
544
>
toolCallId,
545
>
turnId: params.turnId,
546
>
toolName: 'file_edit',
547
>
output,
548
>
});
549
>
const summary = describeFileChange(params.item.changes) || 'Apply file changes';
550
>
return [
551
>
{
552
>
type: ActionType.ChatToolCallStart,
553
>
turnId: params.turnId,
554
>
toolCallId,
555
>
toolName: 'file_edit',
556
>
displayName: 'Apply file changes',
557
>
},
558
>
{
559
>
type: ActionType.ChatToolCallDelta,
560
>
turnId: params.turnId,
561
>
toolCallId,
562
>
content: summary,
563
>
},
564
>
{
565
>
type: ActionType.ChatToolCallReady,
566
>
turnId: params.turnId,
567
>
toolCallId,
568
>
invocationMessage: summary,
569
>
toolInput: summary,
570
>
confirmed: ToolCallConfirmationReason.NotNeeded,
571
>
},
572
>
...(output ? [{
573
>
type: ActionType.ChatToolCallContentChanged,
574
>
turnId: params.turnId,
575
>
toolCallId,
576
>
content: [{ type: ToolResultContentType.Text, text: output }],
577
>
} satisfies SessionAction | ChatAction] : []),
578
>
];
579
>
}
580
if (params.item.type === 'mcpToolCall') {
581
const toolCallId = generateUuid();