Documentation
¶
Overview ¶
Package outputoffload keeps large tool outputs out of the context window: the full text is written to a file under .senior-dev/tool-output and the model sees a bounded extract (head, tail and diagnostic-looking lines) plus the path.
Index ¶
Constants ¶
View Source
const ( HEAD_LINES = 20 TAIL_LINES = 40 EXTRACT_MAX_CHARS = 6_000 OFFLOAD_THRESHOLD_CHARS = 12_000 )
Variables ¶
View Source
var DefaultOffloader = Offloader{Sink: DiskSink{}}
Functions ¶
func ExtractRelevant ¶
func ExtractRelevant(output string, opts *ExtractRelevantOptions) string
ExtractRelevant keeps the head, tail, and diagnostic-looking lines.
Types ¶
type DistillHook ¶
type ExtractRelevantOptions ¶
type Offloader ¶
type Offloader struct {
Sink OutputSink
}
func (Offloader) OffloadLargeOutput ¶
func (o Offloader) OffloadLargeOutput(input OutputOffloadInput, options any) OutputOffloadResult
OffloadLargeOutput applies the offload policy with an injected sink.
type OutputOffloadInput ¶
type OutputOffloadOptions ¶
type OutputOffloadOptions struct {
Hook DistillHook `json:"-"`
EscalationWanted bool `json:"escalationWanted"`
Force bool `json:"-"`
}
type OutputOffloadResult ¶
func OffloadLargeOutput ¶
func OffloadLargeOutput(input OutputOffloadInput, options any) OutputOffloadResult
OffloadLargeOutput uses the production filesystem sink. options accepts nil, OutputOffloadOptions (or a pointer), or a DistillHook.
func (OutputOffloadResult) MarshalJSON ¶
func (r OutputOffloadResult) MarshalJSON() ([]byte, error)
MarshalJSON emits inline first and the optional offloadPath and escalationWanted only when they are set.
Click to show internal directories.
Click to hide internal directories.