agentgit.core package
Submodules
agentgit.core.rollback_protocol module
Rollback protocol for tool operations in the LangGraph agent system.
- class agentgit.core.rollback_protocol.ReverseInvocationResult(tool_name, reversed_successfully, error_message=None)[source]
Bases:
object
Result of a reverse tool operation.
-
error_message:
Optional
[str
] = None
-
reversed_successfully:
bool
-
tool_name:
str
-
error_message:
- class agentgit.core.rollback_protocol.ToolInvocationRecord(tool_name, args, result, success, error_message=None)[source]
Bases:
object
Record of a tool invocation.
-
args:
Dict
[str
,Any
]
-
error_message:
Optional
[str
] = None
-
result:
Any
-
success:
bool
-
tool_name:
str
-
args:
- class agentgit.core.rollback_protocol.ToolRollbackRegistry[source]
Bases:
object
Registry for managing reversible tool operations.
- get_tool(name)[source]
Get a tool specification by name.
- Parameters:
name (
str
) – Tool name- Return type:
Optional
[ToolSpec
]- Returns:
Tool specification or None if not found
- get_track()[source]
Get the current tool invocation track.
- Return type:
List
[ToolInvocationRecord
]- Returns:
List of tool invocation records
- record_invocation(tool_name, args, result, success=True, error_message=None)[source]
Record a tool invocation.
- Parameters:
tool_name (
str
) – Name of the toolargs (
Dict
[str
,Any
]) – Arguments passed to the toolresult (
Any
) – Result from the toolsuccess (
bool
) – Whether the invocation succeedederror_message (
Optional
[str
]) – Optional error message if failed
- redo()[source]
Re-execute forward handlers for recorded tools.
- Return type:
List
[ToolInvocationRecord
]- Returns:
List of new invocation records
- register_tool(spec)[source]
Register a tool with optional reverse handler.
- Parameters:
spec (
ToolSpec
) – Tool specification with forward and optional reverse functions
- rollback()[source]
Rollback all recorded tool invocations.
- Return type:
List
[ReverseInvocationResult
]- Returns:
List of reverse invocation results
Module contents
Core components and protocols for the rollback system.
- class agentgit.core.ReverseInvocationResult(tool_name, reversed_successfully, error_message=None)[source]
Bases:
object
Result of a reverse tool operation.
-
error_message:
Optional
[str
] = None
-
reversed_successfully:
bool
-
tool_name:
str
-
error_message:
- class agentgit.core.ToolInvocationRecord(tool_name, args, result, success, error_message=None)[source]
Bases:
object
Record of a tool invocation.
-
args:
Dict
[str
,Any
]
-
error_message:
Optional
[str
] = None
-
result:
Any
-
success:
bool
-
tool_name:
str
-
args:
- class agentgit.core.ToolRollbackRegistry[source]
Bases:
object
Registry for managing reversible tool operations.
- get_tool(name)[source]
Get a tool specification by name.
- Parameters:
name (
str
) – Tool name- Return type:
Optional
[ToolSpec
]- Returns:
Tool specification or None if not found
- get_track()[source]
Get the current tool invocation track.
- Return type:
List
[ToolInvocationRecord
]- Returns:
List of tool invocation records
- record_invocation(tool_name, args, result, success=True, error_message=None)[source]
Record a tool invocation.
- Parameters:
tool_name (
str
) – Name of the toolargs (
Dict
[str
,Any
]) – Arguments passed to the toolresult (
Any
) – Result from the toolsuccess (
bool
) – Whether the invocation succeedederror_message (
Optional
[str
]) – Optional error message if failed
- redo()[source]
Re-execute forward handlers for recorded tools.
- Return type:
List
[ToolInvocationRecord
]- Returns:
List of new invocation records
- register_tool(spec)[source]
Register a tool with optional reverse handler.
- Parameters:
spec (
ToolSpec
) – Tool specification with forward and optional reverse functions
- rollback()[source]
Rollback all recorded tool invocations.
- Return type:
List
[ReverseInvocationResult
]- Returns:
List of reverse invocation results