Documentation
¶
Index ¶
- type ExternalFileMapping
- type Manager
- func (m *Manager) Cleanup() error
- func (m *Manager) CurrentTurn() int
- func (m *Manager) Diff(turnNum int, path string) (string, error)
- func (m *Manager) Enabled() bool
- func (m *Manager) EndTurn() error
- func (m *Manager) GetModifiedFiles() []string
- func (m *Manager) Initialize() error
- func (m *Manager) IsExternalPath(path string) bool
- func (m *Manager) List() ([]TurnInfo, error)
- func (m *Manager) Restore(turnNum int) ([]string, error)
- func (m *Manager) RestoreFile(path string) ([]byte, error)
- func (m *Manager) SetEnabled(enabled bool)
- func (m *Manager) StartTurn() int
- func (m *Manager) TrackExternalFile(path string) error
- func (m *Manager) Workdir() string
- type TurnInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExternalFileMapping ¶
type ExternalFileMapping struct {
OriginalPath string `json:"original_path"`
FirstTrackedTurn int `json:"first_tracked_turn"`
}
ExternalFileMapping tracks files outside the workdir
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles checkpoint creation and restoration using a shadow git repository
func NewManager ¶
func NewManager(checkpointDir, workdir string, excludePatterns []string, maxFileSizeKB int) (*Manager, error)
NewManager creates a checkpoint manager whose shadow git repository lives in checkpointDir. That directory belongs to the session, so a checkpoint made by one turn is still there for the next, and it must sit outside workdir: the repository snapshots workdir with "git add -A", which would otherwise try to snapshot itself.
func (*Manager) CurrentTurn ¶
CurrentTurn returns the current turn number
func (*Manager) EndTurn ¶
EndTurn commits all changes to the shadow git (called after all tool calls complete)
func (*Manager) GetModifiedFiles ¶
GetModifiedFiles returns a list of all files modified since turn-0 (session start) This uses git to find files that have been changed during this session
func (*Manager) Initialize ¶
Initialize sets up the shadow git repository
func (*Manager) IsExternalPath ¶
IsExternalPath checks if a path is outside the workdir
func (*Manager) RestoreFile ¶
RestoreFile restores a single file to its state at turn 0 (initial state) Returns the content that was restored, or error if file wasn't tracked
func (*Manager) SetEnabled ¶
SetEnabled enables or disables checkpoints
func (*Manager) StartTurn ¶
StartTurn increments the turn counter (called before processing tool calls)
func (*Manager) TrackExternalFile ¶
TrackExternalFile copies a file from outside workdir to external-files/