smart

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const MaxCandidatesPerLLMRequest = 150
View Source
const MaxReadmeChars = 12000

Variables

View Source
var ErrDescriptionRequired = errors.New("project description is required")

Functions

func ReadProjectDescription

func ReadProjectDescription(root string) (string, string, error)

func RenderPromptTree

func RenderPromptTree(rootName string, keptFiles []*scanner.TreeEntry, candidates []*scanner.TreeEntry) string

func ScanDepth

func ScanDepth(ctx context.Context, root string, parents []string, logger *slog.Logger) ([]*scanner.TreeEntry, error)

func ScanDepthWithWarnings

func ScanDepthWithWarnings(ctx context.Context, root string, parents []string, logger *slog.Logger) ([]*scanner.TreeEntry, []scanner.Warning, error)

Types

type DepthProposal

type DepthProposal struct {
	Depth      int
	Candidates []*scanner.TreeEntry
	KeepIDs    map[int]struct{}
	Warnings   []scanner.Warning
}

func ProposeNextDepth

func ProposeNextDepth(ctx context.Context, client LLMClient, model string, state *State, logger *slog.Logger) (DepthProposal, int, error)

type LLMClient

type LLMClient interface {
	ChatCompletion(ctx context.Context, model string, messages []llm.Message) (string, error)
}

type Options

type Options struct {
	Root        string
	Repository  string
	Description string
	Client      LLMClient
	Model       string
	Provider    string
	OutputPath  string
	Logger      *slog.Logger
}

type Result

type Result struct {
	OutputPath        string
	FilesAnalyzed     int
	EstimatedTokens   string
	LLMRequests       int
	Provider          string
	Model             string
	KeptFiles         []string
	DepthsProcessed   int
	OverwroteExisting bool
	Digest            digest.Result
}

func RunAuto

func RunAuto(ctx context.Context, opts Options) (Result, error)

type State

type State struct {
	Root           string
	Description    string
	Depth          int
	CurrentParents []string
	KeptFiles      []*scanner.TreeEntry
}

func NewState

func NewState(root string, description string) *State

func (*State) Apply

func (s *State) Apply(candidates []*scanner.TreeEntry, keepIDs map[int]struct{})

func (*State) KeptFilePaths

func (s *State) KeptFilePaths() []string

func (*State) Tree

func (s *State) Tree() *scanner.Tree

Jump to

Keyboard shortcuts

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