const { aparteGlobalConfig } = window.aparte;
const { setupDiff } = window.apartePlugins.diff;
aparteGlobalConfig.registerToolDisplay('edit_file', { summary: (call) => call.toolCall.input.path });
setupDiff({
tool: 'edit_file',
map: (result, input) => ({ path: input.path, before: result.before, after: result.after }),
});
const before = ['## Install', '', 'npm install spanwise', '', 'Durations are whole hours.', ''].join('\n');
const after = ['## Install', '', 'npm install spanwise', '', 'Durations can be decimal: 1.5h is ninety minutes.', ''].join('\n');
document.querySelector('aparte-chat-bubble').setSegments([
{ id: 's1', type: 'text', content: 'The README promised whole hours only. I changed that line.' },
{
id: 's2', type: 'tool_call', status: 'resolved',
toolCall: { id: 't1', name: 'edit_file', input: { path: 'README.md' } },
result: JSON.stringify({ before, after }),
},
]);