Documentation
¶
Index ¶
- func DetectInputType(input string) agenttypes.InputType
- func NormalizeInput(ctx context.Context, input string, inputType agenttypes.InputType, ...) ([]*httpmsg.HttpRequestResponse, error)
- func ParsePlanFile(raw string) (instruction string, requests []string)
- func TargetURLFromInput(ctx context.Context, input string, inputType agenttypes.InputType, ...) (string, error)
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.
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 ¶
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.