Files
hermes-agent/apps/desktop/src/store/tool-diffs.ts
T
2026-05-02 03:19:39 -05:00

24 lines
513 B
TypeScript

import { atom } from 'nanostores'
const $toolDiffs = atom<Record<string, string>>({})
export function recordToolDiff(toolCallId: string, diff: string) {
if (!toolCallId || !diff) {
return
}
const current = $toolDiffs.get()
if (current[toolCallId] === diff) {
return
}
$toolDiffs.set({ ...current, [toolCallId]: diff })
}
export function getToolDiff(toolCallId: string): string {
return toolCallId ? $toolDiffs.get()[toolCallId] || '' : ''
}
export const $toolInlineDiffs = $toolDiffs