input

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: MIT Imports: 13 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnknownInputFormat = errors.New("unable to detect input format (supported: URL, curl, raw HTTP, Burp XML, base64, record UUID)")

ErrUnknownInputFormat is returned when input matches none of the supported shapes. It names no flag: each command that accepts raw input words its own remedy (replay and fuzz point at -i and --input-file, for instance).

Functions

func DetectInputType

func DetectInputType(input string) agenttypes.InputType

DetectInputType determines the input format from the raw string content. File-shaped inputs (curl command, Burp XML, raw HTTP request) are classified by source.DetectFormatHead, the same content detector -i files use; the agent-only shapes (record UUID, single URL, base64-encoded request) are checked here.

func NormalizeInput

func NormalizeInput(ctx context.Context, input string, inputType agenttypes.InputType, repo *database.Repository) ([]*httpmsg.HttpRequestResponse, error)

NormalizeInput converts a raw input string into HttpRequestResponse objects. The inputType can be empty/unknown, in which case auto-detection is used.

func ParsePlanFile

func ParsePlanFile(raw string) (instruction string, requests []string)

ParsePlanFile splits a plan file into an instruction (free-text guidance) and zero or more raw HTTP request blocks (seed inputs).

Format (no structured header — the file is what an operator would paste):

  • Prose appearing before the first HTTP request becomes the instruction.
  • Fenced ```http / ```request blocks (or any fenced block whose body is a raw HTTP request) are each extracted as one request; everything outside the fences is the instruction.
  • When there are no usable fenced request blocks, the region from the first request line to EOF is split on lines that are exactly "---" into independent request blocks.
  • A file with no request line at all is treated as instruction-only (requests is nil); the caller must then supply --target.

Parsing is lenient: a "---"-delimited block that does not contain a request line is folded back into the instruction rather than rejected. If no fenced block contains an HTTP request, the fenced path is abandoned and the auto-split path runs, so a stray ```bash fence above a real request does not suppress it.

func TargetURLFromInput

func TargetURLFromInput(ctx context.Context, input string, inputType agenttypes.InputType, repo *database.Repository) (string, error)

TargetURLFromInput normalizes a raw input string and extracts the target URL. Useful for commands that need to derive --target from --input.

Types

This section is empty.

Jump to

Keyboard shortcuts

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