Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildImpactGraph ¶
func BuildImpactGraph(docs []PendingDoc, opts ImpactOpts) string
BuildImpactGraph returns the full 3-section ASCII block:
- section 1 — scope tree (per-folder file + token counts)
- section 2 — RELAY block (pre-written user message with computed numbers)
- section 3 — ACTION block (LLM instruction: wait → confirm → process)
Returns a single-line "no pending" message when len(docs) == 0.
func EstimateTokens ¶
EstimateTokens estimates token count using a blended CJK/Latin ratio. CJK ≈ 1 tok/char; Latin/other ≈ 0.25 tok/char. Errs high for CJK-aware models.
func IsAllSensitive ¶
IsAllSensitive returns true when every path has at least one sensitive keyword component.
Types ¶
type CostLine ¶
CostLine is one row in the estimated cost table.
func EstimateCost ¶
EstimateCost returns one CostLine per model, sorted cheapest-first.
type ImpactOpts ¶
type ImpactOpts struct {
ToolName string // "docgraph_embeddings" or "docgraph_enrichment"
ModelHint string // shown in header, e.g. "text-embedding-3-small"
WorkspaceDir string // workspace root (or project root in single-project mode)
Rates []ModelRate // from DefaultRates()
ConfirmationToken string // hex token; empty when all-sensitive or N=0
}
ImpactOpts configures BuildImpactGraph output.
type ModelRate ¶
type ModelRate struct {
Name string
InputPerM float64 // USD per million input tokens
AsOf time.Time // date rates were verified; footer warns if >180 days old
}
ModelRate holds a hardcoded rate for one LLM/embedding model. Rates are intentionally approximate — purpose is order-of-magnitude awareness.
type PendingDoc ¶
type PendingDoc struct {
FilePath string // relative to WorkspaceDir
BodyExcerpt string // from DB; used for token estimation only — no disk read
}
PendingDoc is one document awaiting LLM processing.
type SensitiveFlag ¶
SensitiveFlag marks a folder path that contains at least one sensitive keyword component.
func FlagSensitivePaths ¶
func FlagSensitivePaths(paths []string) []SensitiveFlag
FlagSensitivePaths returns entries where any path component contains a sensitive keyword (case-insensitive substring match within each component).