Documentation
¶
Overview ¶
Package buffer tracks which lines of a file the agent changed and the line delta of one diff. The per-turn content accumulator is internal/turnlog.
Index ¶
- Constants
- func LineDelta(oldText, newText string) (added, removed int)
- type LineRange
- type LineTracker
- func (lt *LineTracker) Clear(chatID marotte.ChatID)
- func (lt *LineTracker) Get(chatID marotte.ChatID, filePath string) []LineRange
- func (lt *LineTracker) Record(chatID marotte.ChatID, filePath string, r LineRange)
- func (lt *LineTracker) RecordFromDiffs(chatID marotte.ChatID, diffs []marotte.ToolDiff, turn int, kind string)
Constants ¶
const DefaultOutputCap = 64 * 1024
DefaultOutputCap is the shared byte budget for subprocess output buffers: a 200×50 screen with heavy ANSI.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LineRange ¶
type LineRange struct {
Kind string `json:"kind"`
StartLine int `json:"start_line"`
EndLine int `json:"end_line"`
Turn int `json:"turn"`
}
LineRange is a range of lines modified by the agent.
type LineTracker ¶
type LineTracker struct {
// contains filtered or unexported fields
}
LineTracker tracks per-file line changes across all chats.
func (*LineTracker) Clear ¶
func (lt *LineTracker) Clear(chatID marotte.ChatID)
Clear removes all tracking data for a chat.
func (*LineTracker) Get ¶
func (lt *LineTracker) Get(chatID marotte.ChatID, filePath string) []LineRange
Get returns a copy of the line ranges for a file in a chat: the HTTP handler reads after the lock is released while Record keeps appending to the same key.
func (*LineTracker) Record ¶
func (lt *LineTracker) Record(chatID marotte.ChatID, filePath string, r LineRange)
Record adds a line range for a file change. A LineRange, not three adjacent ints: a silent transposition would invert the gutter range or corrupt the eviction key, since the heap orders files by lastTurn.
func (*LineTracker) RecordFromDiffs ¶
func (lt *LineTracker) RecordFromDiffs(chatID marotte.ChatID, diffs []marotte.ToolDiff, turn int, kind string)
RecordFromDiffs records one range per diff hunk, in new-text line numbers, so KAS's whole-file NewText does not mark every line. A whole-file rewrite yields one full span.