output

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2026 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ANSIReset  = "\033[0m"
	ANSIBold   = "\033[1m"
	ANSIDim    = "\033[2m"
	ANSIRed    = "\033[31m"
	ANSIGreen  = "\033[32m"
	ANSIYellow = "\033[33m"
	ANSICyan   = "\033[36m"
)
View Source
const (
	ToolDataService  = "service"
	ToolDataWeb      = "web"
	ToolDataWeakpass = "weakpass"
	ToolDataVuln     = "vuln"
	// ToolDataProgress carries one raw stdout/stderr line of a foreground
	// command, streamed while it runs.
	ToolDataProgress = "progress"
)
View Source
const (
	LootFingerprint = parsers.LootFingerprint
	LootWeakpass    = parsers.LootWeakpass
	LootVuln        = parsers.LootVuln
)

Variables

This section is empty.

Functions

func BuildTimelineMarkdown

func BuildTimelineMarkdown(entries []TimelineEntry) string

func CallIDFromContext added in v0.3.0

func CallIDFromContext(ctx context.Context) string

func CompactStrings

func CompactStrings(values ...string) []string

func ContextWithCallID added in v0.3.0

func ContextWithCallID(ctx context.Context, callID string) context.Context

func FirstNonEmpty

func FirstNonEmpty(values ...string) string

func FormatLine

func FormatLine(prefix, body string, color Color) string

func OutputPrefix

func OutputPrefix(source string, colorFn func(string) string) string

func RenderFile

func RenderFile(path, format, outputPath string) error

RenderFile renders an AOP Event ProtoJSONL file. Raw scanner JSONL files are intentionally not accepted as agent timelines.

func RenderTimeline

func RenderTimeline(w io.Writer, entries []TimelineEntry) error

func RenderTimelineMarkdown

func RenderTimelineMarkdown(w io.Writer, entries []TimelineEntry) error

func SanitizeLine

func SanitizeLine(line string, color Color) string

func StripANSI

func StripANSI(s string) string

func TruncateStr

func TruncateStr(s string, maxLen int) string

Types

type ArtifactStream added in v0.4.0

type ArtifactStream struct {
	// contains filtered or unexported fields
}

ArtifactStream serializes structured ToolData events and exposes one lifecycle-bound handler for either a node transport or the local server.

func NewArtifactStream added in v0.4.0

func NewArtifactStream(bus *eventbus.Bus[ToolDataEvent]) *ArtifactStream

func (*ArtifactStream) Close added in v0.4.0

func (s *ArtifactStream) Close()

func (*ArtifactStream) SetHandler added in v0.4.0

func (s *ArtifactStream) SetHandler(handler func(ToolArtifact))

type Color

type Color struct {
	Enabled bool
}

func NewColor

func NewColor(enabled bool) Color

func (Color) Bold

func (c Color) Bold(s string) string

func (Color) Code

func (c Color) Code(code string) string

func (Color) Cyan

func (c Color) Cyan(s string) string

func (Color) Dim

func (c Color) Dim(s string) string

func (Color) ForPriority

func (c Color) ForPriority(p string) func(string) string

func (Color) Green

func (c Color) Green(s string) string

func (Color) GreenBold

func (c Color) GreenBold(s string) string

func (Color) Red

func (c Color) Red(s string) string

func (Color) Status

func (c Color) Status(s string) string

func (Color) Wrap added in v0.2.7

func (c Color) Wrap(s, code string) string

func (Color) Yellow

func (c Color) Yellow(s string) string

func (Color) YellowBold

func (c Color) YellowBold(s string) string

type Error

type Error struct {
	Source  string `json:"source,omitempty"`
	Message string `json:"message"`
}

type Loot

type Loot = parsers.Loot

type ScanResult added in v0.4.0

type ScanResult struct {
	Summary Summary                `json:"summary"`
	GOGO    []*parsers.GOGOResult  `json:"gogo,omitempty"`
	Spray   []*parsers.SprayResult `json:"spray,omitempty"`
	Loots   []Loot                 `json:"loots,omitempty"`
	Errors  []Error                `json:"errors,omitempty"`
}

ScanResult is private collector state. Scanner-native records leave a node only as ToolArtifact messages; the server owns normalization and persistence.

type Summary

type Summary struct {
	Inputs     int       `json:"inputs"`
	Ports      int       `json:"ports"`
	Web        int       `json:"web"`
	URLs       int       `json:"urls"`
	Findings   int       `json:"findings"`
	Errors     int       `json:"errors"`
	Tasks      int64     `json:"tasks"`
	Requests   int64     `json:"requests"`
	Duration   string    `json:"duration"`
	StartedAt  time.Time `json:"started_at,omitempty"`
	FinishedAt time.Time `json:"finished_at,omitempty"`
}

type TimelineEntry

type TimelineEntry struct {
	Timestamp time.Time
	Type      string
	Data      any
}

func ParseTimelineFile

func ParseTimelineFile(path string) ([]TimelineEntry, error)

type ToolArtifact added in v0.4.0

type ToolArtifact struct {
	Tool      string
	Kind      string
	Target    string
	Data      json.RawMessage
	CallID    string
	Timestamp time.Time
}

ToolArtifact is one scanner-native structured record. Nodes forward it unchanged; only the server normalizes it into canonical SCO documents.

type ToolDataEvent added in v0.2.8

type ToolDataEvent struct {
	Tool      string    `json:"tool"`
	Kind      string    `json:"kind"`
	Target    string    `json:"target,omitempty"`
	Data      any       `json:"data"`
	CallID    string    `json:"call_id,omitempty"`
	Timestamp time.Time `json:"timestamp"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL