chore: uptick
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
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
|
||||
Reference in New Issue
Block a user