core

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2025 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentQuery

type AgentQuery struct {
	Type     string       `json:"type"`               // function, struct, class, etc
	Name     string       `json:"name,omitempty"`     // name pattern with wildcards
	Contains *AgentQuery  `json:"contains,omitempty"` // nested queries
	Operator string       `json:"operator,omitempty"` // AND, OR, NOT
	Operands []AgentQuery `json:"operands,omitempty"` // for compound queries
}

AgentQuery represents a natural language query for code elements

type ConfidenceFactor

type ConfidenceFactor struct {
	Name   string  `json:"name"`
	Impact float64 `json:"impact"` // -1.0 to 1.0
	Reason string  `json:"reason"`
}

ConfidenceFactor explains score calculation

type ConfidenceScore

type ConfidenceScore struct {
	Score   float64            `json:"score"` // 0.0 to 1.0
	Level   string             `json:"level"` // high, medium, low
	Factors []ConfidenceFactor `json:"factors"`
}

ConfidenceScore for transformations

type Location

type Location struct {
	File      string `json:"file,omitempty"`
	Line      int    `json:"line"`
	Column    int    `json:"column"`
	EndLine   int    `json:"end_line,omitempty"`
	EndColumn int    `json:"end_column,omitempty"`
}

Location in source code

type Match

type Match struct {
	Type     string   `json:"type"`
	Name     string   `json:"name"`
	Location Location `json:"location"`
	Content  string   `json:"content,omitempty"`
	Scope    string   `json:"scope,omitempty"`  // file, function, class
	Parent   string   `json:"parent,omitempty"` // parent element name
}

Match represents a found code element

type QueryResult

type QueryResult struct {
	Matches []Match `json:"matches"`
	Total   int     `json:"total"`
	Error   error   `json:"-"`
}

QueryResult from provider

type TransformOp

type TransformOp struct {
	Method      string     `json:"method"`                // replace, delete, insert_before, etc
	Target      AgentQuery `json:"target"`                // what to find
	Content     string     `json:"content,omitempty"`     // for insert/append
	Replacement string     `json:"replacement,omitempty"` // for replace
}

TransformOp represents a transformation operation

type TransformResult

type TransformResult struct {
	Modified   string                 `json:"modified"`
	Diff       string                 `json:"diff"`
	Confidence ConfidenceScore        `json:"confidence"`
	MatchCount int                    `json:"match_count"`        // Number of elements matched/transformed
	Metadata   map[string]interface{} `json:"metadata,omitempty"` // Additional info (strategy, etc)
	Error      error                  `json:"-"`
}

TransformResult from provider

Jump to

Keyboard shortcuts

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