fileinventory

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package fileinventory indexes workspace files for search and context views.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderText

func RenderText(w io.Writer, report Report)

Types

type Entry

type Entry struct {
	Path  string `json:"path"`
	Size  int64  `json:"size"`
	Ext   string `json:"ext,omitempty"`
	Depth int    `json:"depth"`
}

type Options

type Options struct {
	Path             string
	Glob             string
	Limit            int
	IncludeHidden    bool
	RespectGitignore bool
}

type Report

type Report struct {
	Kind             string    `json:"kind"`
	Action           string    `json:"action"`
	Root             string    `json:"root"`
	Path             string    `json:"path,omitempty"`
	Glob             string    `json:"glob,omitempty"`
	Total            int       `json:"total"`
	Limit            int       `json:"limit"`
	Truncated        bool      `json:"truncated"`
	Bytes            int64     `json:"bytes"`
	RespectGitignore bool      `json:"respect_gitignore"`
	Files            []Entry   `json:"files"`
	ScopeRisk        ScopeRisk `json:"scope_risk"`
}

func Build

func Build(workspace string, opts Options) (Report, error)

type ScopeRisk

type ScopeRisk struct {
	Status          string          `json:"status"`
	Level           string          `json:"level"`
	Summary         string          `json:"summary"`
	SinkCount       int             `json:"sink_count"`
	Sinks           []ScopeRiskSink `json:"sinks,omitempty"`
	Recommendations []string        `json:"recommendations,omitempty"`
}

ScopeRisk summarizes token-risk preflight findings for a workspace scan.

type ScopeRiskSink

type ScopeRiskSink struct {
	Path           string `json:"path"`
	Kind           string `json:"kind"`
	Reason         string `json:"reason"`
	Size           int64  `json:"size,omitempty"`
	Recommendation string `json:"recommendation"`
}

ScopeRiskSink describes one path that may bloat context or token usage.

Jump to

Keyboard shortcuts

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