contextreport

package
v0.14.0 Latest Latest
Warning

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

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

View Source
const (
	CategorySystemPrompt      = "system_prompt"
	CategoryProjectGuidelines = "project_guidelines"
	CategoryWorkspaceMap      = "workspace_map"
	CategoryTools             = "tools"
	CategoryFree              = "free"
)
View Source
const ContractV1 = "zero.context.report.v1"
View Source
const RuntimeGo = "go"

Variables

This section is empty.

Functions

func Format

func Format(report Report) string

Types

type Category

type Category struct {
	Key     string  `json:"key"`
	Name    string  `json:"name"`
	Tokens  int     `json:"tokens"`
	Percent float64 `json:"percent"`
}

type Options

type Options struct {
	WorkspaceRoot       string
	Provider            config.ProviderProfile
	Registry            *tools.Registry
	ContextWindow       int
	DeferThreshold      int
	ProjectContextFiles []string
}

type Report

type Report struct {
	Contract             string     `json:"contract"`
	Runtime              string     `json:"runtime"`
	Root                 string     `json:"root"`
	ProviderName         string     `json:"providerName,omitempty"`
	ProviderKind         string     `json:"providerKind,omitempty"`
	ModelID              string     `json:"modelId,omitempty"`
	APIModel             string     `json:"apiModel,omitempty"`
	ContextWindow        int        `json:"contextWindow"`
	UsedTokens           int        `json:"usedTokens"`
	FreeTokens           int        `json:"freeTokens"`
	UsedFraction         float64    `json:"usedFraction"`
	ToolCount            int        `json:"toolCount"`
	AvailableToolCount   int        `json:"availableToolCount,omitempty"`
	DeferredToolCount    int        `json:"deferredToolCount,omitempty"`
	ProjectGuidelineFile string     `json:"projectGuidelineFile,omitempty"`
	Categories           []Category `json:"categories"`
}

func Build

func Build(options Options) (Report, error)

Jump to

Keyboard shortcuts

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