119
});
120
}
122
>
id: generateUuid(),
123
>
parentId,
124
>
timestamp: nextTimestamp(),
125
>
type: 'tool.execution_start',
126
>
data: {
127
>
toolCallId: tc.toolCallId,
128
>
toolName: tc.toolName,
129
>
...(toolArguments ? { arguments: toolArguments } : {}),
130
>
},
131
>
});
132
>
const resultText = extractToolResultText(tc.content);
133
>
push({
134
>
id: generateUuid(),
135
>
parentId,
136
>
timestamp: nextTimestamp(),
137
>
type: 'tool.execution_complete',
138
>
data: {
139
>
toolCallId: tc.toolCallId,
140
>
success: tc.success,
141
>
...(tc.success ? { result: { content: resultText } } : {}),
142
>
...(tc.error ? { error: { message: tc.error.message, ...(tc.error.code ? { code: tc.error.code } : {}) } } : {}),
143
>
},
144
>
});
145
>
};
146
147
push({