Documentation
¶
Overview ¶
Package debugging provides debugging and codebase analysis tools for ZAP.
Index ¶
- type AnalyzeEndpointParams
- type AnalyzeEndpointTool
- type AnalyzeFailureParams
- type AnalyzeFailureTool
- type AutoFixParams
- type AutoFixTool
- type CreateTestFileParams
- type CreateTestFileTool
- type FindHandlerParams
- type FindHandlerTool
- type HandlerInfo
- type ListFilesTool
- type ProposeFixParams
- type ProposeFixTool
- type ReadFileTool
- type SearchCodeTool
- type WriteFileParams
- type WriteFileTool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnalyzeEndpointParams ¶
type AnalyzeEndpointParams struct {
EndpointDescription string `json:"endpoint_description"`
Method string `json:"method"`
URL string `json:"url"`
SampleRequest string `json:"sample_request,omitempty"`
Context string `json:"context,omitempty"`
}
AnalyzeEndpointParams defines input for analyze_endpoint
type AnalyzeEndpointTool ¶
type AnalyzeEndpointTool struct {
// contains filtered or unexported fields
}
AnalyzeEndpointTool uses LLM to analyze API endpoint structure
func NewAnalyzeEndpointTool ¶
func NewAnalyzeEndpointTool(llmClient llm.LLMClient) *AnalyzeEndpointTool
NewAnalyzeEndpointTool creates a new analyze_endpoint tool
func (*AnalyzeEndpointTool) Description ¶
func (t *AnalyzeEndpointTool) Description() string
func (*AnalyzeEndpointTool) Execute ¶
func (t *AnalyzeEndpointTool) Execute(args string) (string, error)
func (*AnalyzeEndpointTool) Name ¶
func (t *AnalyzeEndpointTool) Name() string
func (*AnalyzeEndpointTool) Parameters ¶
func (t *AnalyzeEndpointTool) Parameters() string
type AnalyzeFailureParams ¶
type AnalyzeFailureParams struct {
TestResult shared.TestResult `json:"test_result"`
ResponseBody string `json:"response_body"`
ExpectedBehavior string `json:"expected_behavior"`
}
AnalyzeFailureParams defines input for analyze_failure
type AnalyzeFailureTool ¶
type AnalyzeFailureTool struct {
// contains filtered or unexported fields
}
AnalyzeFailureTool uses LLM to explain test failures
func NewAnalyzeFailureTool ¶
func NewAnalyzeFailureTool(llmClient llm.LLMClient) *AnalyzeFailureTool
NewAnalyzeFailureTool creates a new analyze_failure tool
func (*AnalyzeFailureTool) Description ¶
func (t *AnalyzeFailureTool) Description() string
func (*AnalyzeFailureTool) Execute ¶
func (t *AnalyzeFailureTool) Execute(args string) (string, error)
func (*AnalyzeFailureTool) Name ¶
func (t *AnalyzeFailureTool) Name() string
func (*AnalyzeFailureTool) Parameters ¶
func (t *AnalyzeFailureTool) Parameters() string
type AutoFixParams ¶
type AutoFixParams struct {
Endpoint string `json:"endpoint"` // e.g. "POST /api/users"
BaseURL string `json:"base_url"` // e.g. "http://localhost:8080"
Scenario *shared.TestScenario `json:"scenario,omitempty"` // optional pre-built scenario
ExpectedStatus int `json:"expected_status,omitempty"` // default 200
MaxAttempts int `json:"max_attempts,omitempty"` // default 3
}
AutoFixParams defines input for auto_fix.
type AutoFixTool ¶
type AutoFixTool struct {
// contains filtered or unexported fields
}
AutoFixTool orchestrates the full fix-and-verify loop: run test → analyze failure → find handler → propose fix → write (with confirmation) → re-run test. Retries up to MaxAttempts times if each fix attempt still fails.
func NewAutoFixTool ¶
func NewAutoFixTool( findHandler *FindHandlerTool, readFile *ReadFileTool, proposeFix *ProposeFixTool, writeFile *WriteFileTool, testExecutor *shared.TestExecutor, analyzeFailure *AnalyzeFailureTool, ) *AutoFixTool
NewAutoFixTool creates a new auto_fix orchestrator.
func (*AutoFixTool) Description ¶
func (t *AutoFixTool) Description() string
func (*AutoFixTool) Name ¶
func (t *AutoFixTool) Name() string
func (*AutoFixTool) Parameters ¶
func (t *AutoFixTool) Parameters() string
func (*AutoFixTool) SetEventCallback ¶
func (t *AutoFixTool) SetEventCallback(callback core.EventCallback)
SetEventCallback implements ConfirmableTool — propagates to WriteFileTool so the TUI confirmation dialog fires correctly when write_file is called internally.
type CreateTestFileParams ¶
type CreateTestFileTool ¶
type CreateTestFileTool struct {
// contains filtered or unexported fields
}
CreateTestFileTool generates framework-specific test files
func NewCreateTestFileTool ¶
func NewCreateTestFileTool(llmClient llm.LLMClient) *CreateTestFileTool
func (*CreateTestFileTool) Description ¶
func (t *CreateTestFileTool) Description() string
func (*CreateTestFileTool) Execute ¶
func (t *CreateTestFileTool) Execute(args string) (string, error)
func (*CreateTestFileTool) Name ¶
func (t *CreateTestFileTool) Name() string
func (*CreateTestFileTool) Parameters ¶
func (t *CreateTestFileTool) Parameters() string
type FindHandlerParams ¶
type FindHandlerParams struct {
Endpoint string `json:"endpoint"`
Method string `json:"method"`
Path string `json:"path"`
Framework string `json:"framework"`
}
FindHandlerParams defines input for find_handler
type FindHandlerTool ¶
type FindHandlerTool struct {
// contains filtered or unexported fields
}
FindHandlerTool locates endpoint handlers in the codebase
func NewFindHandlerTool ¶
func NewFindHandlerTool(workDir string) *FindHandlerTool
NewFindHandlerTool creates a new find_handler tool It internally creates a SearchCodeTool, which is also in the debugging package.
func (*FindHandlerTool) Description ¶
func (t *FindHandlerTool) Description() string
func (*FindHandlerTool) Name ¶
func (t *FindHandlerTool) Name() string
func (*FindHandlerTool) Parameters ¶
func (t *FindHandlerTool) Parameters() string
type HandlerInfo ¶
type HandlerInfo struct {
File string `json:"file"`
Line int `json:"line"`
Content string `json:"content"`
RelatedFiles []string `json:"related_files"`
Analysis string `json:"analysis"`
}
HandlerInfo contains details about a discovered handler
type ListFilesTool ¶
type ListFilesTool struct {
// contains filtered or unexported fields
}
ListFilesTool lists files in a directory with glob patterns
func NewListFilesTool ¶
func NewListFilesTool(workDir string) *ListFilesTool
NewListFilesTool creates a new file listing tool
func (*ListFilesTool) Description ¶
func (t *ListFilesTool) Description() string
func (*ListFilesTool) Name ¶
func (t *ListFilesTool) Name() string
func (*ListFilesTool) Parameters ¶
func (t *ListFilesTool) Parameters() string
type ProposeFixParams ¶
type ProposeFixTool ¶
type ProposeFixTool struct {
// contains filtered or unexported fields
}
ProposeFixTool generates and applies code fixes
func NewProposeFixTool ¶
func NewProposeFixTool(llmClient llm.LLMClient, workDir string) *ProposeFixTool
NewProposeFixTool creates a new propose_fix tool
func (*ProposeFixTool) Description ¶
func (t *ProposeFixTool) Description() string
func (*ProposeFixTool) Name ¶
func (t *ProposeFixTool) Name() string
func (*ProposeFixTool) Parameters ¶
func (t *ProposeFixTool) Parameters() string
type ReadFileTool ¶
type ReadFileTool struct {
// contains filtered or unexported fields
}
ReadFileTool reads file contents
func NewReadFileTool ¶
func NewReadFileTool(workDir string) *ReadFileTool
NewReadFileTool creates a new file reading tool
func (*ReadFileTool) Description ¶
func (t *ReadFileTool) Description() string
func (*ReadFileTool) Name ¶
func (t *ReadFileTool) Name() string
func (*ReadFileTool) Parameters ¶
func (t *ReadFileTool) Parameters() string
type SearchCodeTool ¶
type SearchCodeTool struct {
// contains filtered or unexported fields
}
SearchCodeTool searches for patterns in the codebase
func NewSearchCodeTool ¶
func NewSearchCodeTool(workDir string) *SearchCodeTool
NewSearchCodeTool creates a new code search tool
func (*SearchCodeTool) Description ¶
func (t *SearchCodeTool) Description() string
Description returns the tool description
func (*SearchCodeTool) Execute ¶
func (t *SearchCodeTool) Execute(args string) (string, error)
Execute searches for patterns in the codebase
func (*SearchCodeTool) Parameters ¶
func (t *SearchCodeTool) Parameters() string
Parameters returns the tool parameter description
type WriteFileParams ¶
type WriteFileParams struct {
Path string `json:"path"` // File path to write
Content string `json:"content"` // Content to write
}
WriteFileParams defines the parameters for the write_file tool.
type WriteFileTool ¶
type WriteFileTool struct {
// contains filtered or unexported fields
}
WriteFileTool writes or modifies files with human-in-the-loop confirmation.
func NewWriteFileTool ¶
func NewWriteFileTool(workDir string, confirmManager *shared.ConfirmationManager) *WriteFileTool
NewWriteFileTool creates a new file writing tool.
func (*WriteFileTool) Description ¶
func (t *WriteFileTool) Description() string
Description returns the tool description.
func (*WriteFileTool) Execute ¶
func (t *WriteFileTool) Execute(args string) (string, error)
Execute writes a file after user confirmation.
func (*WriteFileTool) Parameters ¶
func (t *WriteFileTool) Parameters() string
Parameters returns the tool parameter description.
func (*WriteFileTool) SetEventCallback ¶
func (t *WriteFileTool) SetEventCallback(callback core.EventCallback)
SetEventCallback sets the callback for emitting events to the TUI. This implements the ConfirmableTool interface.