Documentation
¶
Index ¶
- func ApplyMode(filePath, content string, opts Options) (string, error)
- func Build(filePath, content string, opts Options) (string, int, int, error)
- func CacheStats() cache.LRUStats
- func DefaultStorePath() string
- func DetectAutoMode(filePath, content string, startLine, endLine int) filter.ReadMode
- func ResolveMode(mode, filePath, content string, startLine, endLine int) (filter.ReadMode, error)
- func TrackedCommandKinds() []string
- func TrackedCommandPatterns() []string
- func TrackedCommandPatternsForKind(kind string) []string
- type Bundle
- type Metadata
- type Options
- type RenderEntry
- type Snapshot
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CacheStats ¶
CacheStats returns smart-read render cache statistics.
func DefaultStorePath ¶
func DefaultStorePath() string
DefaultStorePath returns the persisted smart-read snapshot file path.
func DetectAutoMode ¶
DetectAutoMode picks a reasonable default context mode for the file contents.
func ResolveMode ¶
ResolveMode translates user input into a read mode.
func TrackedCommandKinds ¶
func TrackedCommandKinds() []string
TrackedCommandKinds returns the supported smart-read categories.
func TrackedCommandPatterns ¶
func TrackedCommandPatterns() []string
TrackedCommandPatterns returns the command patterns used to summarize smart context-read activity in tracking views.
func TrackedCommandPatternsForKind ¶
TrackedCommandPatternsForKind returns command patterns for one smart-read kind.
Types ¶
type Bundle ¶
type Bundle struct {
TargetFile string
RelatedFiles []string
Content string
OriginalTokens int
FinalTokens int
}
Bundle captures a graph-aware context bundle.
type Metadata ¶
type Metadata struct {
Kind string
RequestedMode string
ResolvedMode string
Target string
RelatedFiles int
Bundle bool
}
Metadata describes how smart-read content was produced.
type Options ¶
type Options struct {
Level string
Mode string
MaxLines int
MaxTokens int
LineNumbers bool
StartLine int
EndLine int
SaveSnapshot bool
RelatedFiles int
}
Options control smart read rendering for files and MCP clients.
type RenderEntry ¶
type RenderEntry struct {
Key string `json:"key"`
Output string `json:"output"`
OriginalTokens int `json:"original_tokens"`
FinalTokens int `json:"final_tokens"`
UpdatedAt time.Time `json:"updated_at"`
}
RenderEntry stores a persisted smart-read render result for reuse across process restarts.
type Snapshot ¶
type Snapshot struct {
Path string `json:"path"`
Fingerprint string `json:"fingerprint"`
Content string `json:"content"`
UpdatedAt time.Time `json:"updated_at"`
}
Snapshot stores the last seen contents for a path so future reads can emit deltas.
type Store ¶
type Store struct {
Snapshots map[string]Snapshot `json:"snapshots"`
RenderCache map[string]RenderEntry `json:"render_cache,omitempty"`
}
Store is a small persisted state file used by smart read flows.
func (*Store) GetRender ¶
func (s *Store) GetRender(key string) (RenderEntry, bool)
GetRender looks up a persisted render cache entry.