Documentation
¶
Overview ¶
Package output defines redaction and truncation contracts for agent-visible output.
Index ¶
Constants ¶
const DefaultMaxLineCap = 1 << 20
DefaultMaxLineCap bounds an unterminated streaming line before it is forced through redaction. It is intentionally far larger than ordinary secrets.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Filter ¶
type Filter interface {
Apply(stdout string, stderr string) FilterResult
}
Filter redacts and truncates command output before it is returned to an agent.
type FilterResult ¶
FilterResult is the agent-visible output after redaction and truncation.
type StreamFilter ¶
type StreamFilter interface {
Filter
NewStreamWriter(dst io.Writer) *StreamWriter
}
StreamFilter is a compiled filter that can also redact incremental output.
type StreamWriter ¶
type StreamWriter struct {
// contains filtered or unexported fields
}
StreamWriter line-buffers, redacts, truncates, and forwards one output stream.
It assumes a single goroutine calls Write. Stdout and stderr must use separate instances.
func (*StreamWriter) Emitted ¶
func (w *StreamWriter) Emitted() []byte
func (*StreamWriter) Flush ¶
func (w *StreamWriter) Flush()
Flush emits the final unterminated line after command execution has finished.
func (*StreamWriter) Redactions ¶
func (w *StreamWriter) Redactions() int
func (*StreamWriter) Truncated ¶
func (w *StreamWriter) Truncated() bool