codenav

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2026 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterSourceFiles

func FilterSourceFiles(paths []string) []string

FilterSourceFiles returns only source code paths, excluding assets, tests, vendored code, lock files, and docs.

func FormatTreeForLLM

func FormatTreeForLLM(paths []string) string

FormatTreeForLLM formats file paths as a compact list for LLM prompts.

Types

type CodeContext

type CodeContext struct {
	Files []FileContent
}

CodeContext holds fetched source files and can format them for inclusion in an LLM prompt.

func (CodeContext) FormatForPrompt

func (cc CodeContext) FormatForPrompt() string

FormatForPrompt returns a markdown-formatted string of all fetched files, suitable for inclusion in an LLM prompt. Returns "" if no files are present.

type FileContent

type FileContent struct {
	Path    string
	Content string
}

FileContent holds the path and decoded content of a source file.

type Navigator struct {
	// contains filtered or unexported fields
}

Navigator identifies relevant source files for a bug report using the LLM, then fetches their contents via the GitHub Contents API.

func New

func New(github *gh.Client, llm llm.Provider, logger *slog.Logger) *Navigator

New creates a new Navigator.

func (n *Navigator) Navigate(ctx context.Context, installationID int64, repo, title, body, projectName string) (CodeContext, error)

Navigate fetches the repository tree, asks the LLM to identify relevant files, validates the paths, and returns a CodeContext with their contents.

Jump to

Keyboard shortcuts

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