repomap

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: MIT Imports: 7 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

Overview

Package repomap scans a workspace into a compact, deterministic repository map.

Index

Constants

View Source
const (
	DefaultMaxFiles = workspaceindex.DefaultMaxFiles
	DefaultMaxDepth = workspaceindex.DefaultMaxDepth
)
View Source
const (
	MatchReasonExactBasename  = "exact-basename"
	MatchReasonPrefixBasename = "prefix-basename"
	MatchReasonPathSegment    = "path-segment"
	MatchReasonSubstring      = "substring"
	MatchReasonFuzzy          = "fuzzy"
	MatchReasonMultiTerm      = "multi-term"
)

Variables

This section is empty.

Functions

func RenderPrompt

func RenderPrompt(snapshot Snapshot, budget int) string

RenderPrompt renders a compact, deterministic repository map without exceeding budget bytes. For very small budgets it returns an empty string.

Types

type Count

type Count struct {
	Name  string `json:"name"`
	Count int    `json:"fileCount"`
}

type File

type File struct {
	Path      string `json:"path"`
	Language  string `json:"language,omitempty"`
	Extension string `json:"extension,omitempty"`
	Depth     int    `json:"depth,omitempty"`
}

type Options

type Options struct {
	MaxFiles int
	// MaxDepth is measured as path separators below the root. Zero means root
	// files only; negative values use DefaultMaxDepth.
	MaxDepth            int
	MaxBytesPerFileName int
}

type RepoMap

type RepoMap = Snapshot

RepoMap is kept as a semantic alias for call sites/tests that use the product term instead of the storage term.

type SearchResult

type SearchResult struct {
	Path   string
	Score  int
	Reason string
}
func Search(snapshot Snapshot, query string, limit int) []SearchResult

type Snapshot

type Snapshot struct {
	Root            string   `json:"root"`
	Files           []File   `json:"files"`
	FileCount       int      `json:"fileCount"`
	DirectoryCount  int      `json:"directoryCount"`
	MaxDepth        int      `json:"maxDepth"`
	LanguageCounts  []Count  `json:"languages"`
	ExtensionCounts []Count  `json:"extensions"`
	ImportantFiles  []string `json:"importantFiles"`
	Tree            []string `json:"tree"`
	Truncated       bool     `json:"truncated,omitempty"`
}

func Scan

func Scan(root string, options Options) (Snapshot, error)

Jump to

Keyboard shortcuts

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