diff static method
Implementation
static AgentSessionDocumentPatch diff(
AgentSessionDocument previous,
AgentSessionDocument next,
) {
if (identical(previous, next)) return AgentSessionDocumentPatch();
var changes = AgentSessionDocumentPatch();
if (previous.id != next.id) changes = changes.withId(next.id);
if (previous.status != next.status)
changes = changes.withStatus(next.status);
if (!zorphyCollectionEquals(previous.messages, next.messages))
changes = changes.withMessages(next.messages);
if (!zorphyCollectionEquals(previous.toolCalls, next.toolCalls))
changes = changes.withToolCalls(next.toolCalls);
if (previous.activeTool != next.activeTool)
changes = changes.withActiveTool(next.activeTool);
if (previous.turns != next.turns) changes = changes.withTurns(next.turns);
return changes;
}