input

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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