Diff class final

File changes produced by a tool call.

changes is authoritative for affected absolute paths and operations. patch optionally carries renderable text for some or all of those changes and MUST be consistent with changes. Agents SHOULD provide patch whenever feasible. Clients MUST handle diffs where patch is omitted or null.

See protocol docs: Content

Implemented types
Annotations
  • @JsonSerializable.new(createFactory: false, createToJson: false)

Constructors

Diff({required List<DiffChange> changes, DiffPatch? patch, AcpJsonObject? meta})
Creates a Diff value.
Diff.fromJson(Map<String, Object?> json)
Decodes a JSON object, discarding recoverable issues.
factory

Properties

changes List<DiffChange>
Structured file changes described by this diff.
final
hashCode int
The hash code for this object.
no setterinherited
meta AcpJsonObject?
The _meta property is reserved by ACP to allow clients and agents to attach additional metadata to their interactions. Implementations MUST NOT make assumptions about values at these keys.
final
patch DiffPatch?
Renderable patch text for some or all of the structured changes.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toAcpJson() AcpJsonObject
Converts this protocol value to its immutable JSON representation.
override
toJson() Map<String, Object?>
Encodes this value to its wire object.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

decode(Object? json) → AcpDecoded<Diff>
Decodes this model and reports recoverable issues.