Documentation
¶
Index ¶
- type BudgetInfo
- type DependencyInfo
- type DirectoryNode
- type FileInfo
- type FileStatistics
- type FilterConfig
- type Formatter
- type GitInfo
- type JSONLFormatter
- type MarkdownFormatter
- type Metadata
- type OutputFormat
- type PTXFormatter
- type ProjectAnalysis
- type ProjectOutput
- type ProjectOverview
- type TOONEncoder
- type TOONStrictFormatter
- type TruncationInfo
- type XMLFormatter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BudgetInfo ¶ added in v0.5.0
type BudgetInfo struct {
MaxTokens int `xml:"maxTokens"` // Maximum token budget (0 = unlimited)
EstimatedTokens int `xml:"estimatedTokens"` // Actual estimated tokens in output
FileTruncations int `xml:"fileTruncations"` // Number of files that were truncated
}
BudgetInfo tracks token budget and truncation statistics (PTX v2.0)
type DependencyInfo ¶
type DirectoryNode ¶
type DirectoryNode struct {
Name string `xml:"name,attr"`
Type string `xml:"type,attr"` // "file" or "dir"
Children []*DirectoryNode `xml:"node,omitempty"`
}
DirectoryNode represents a node in the directory tree
func (*DirectoryNode) ToMarkdown ¶
func (d *DirectoryNode) ToMarkdown(level int) string
Helper function to convert DirectoryNode to markdown string
type FileInfo ¶
type FileInfo struct {
Path string `xml:"path,attr"`
Content string `xml:"content"`
Tokens int `xml:"tokens,omitempty"` // PTX v2.0: Token count for this file
Truncation *TruncationInfo `xml:"truncation,omitempty"` // PTX v2.0: Truncation metadata if file was truncated
}
type FileStatistics ¶
type FilterConfig ¶ added in v0.5.0
type FilterConfig struct {
Includes []string `xml:"includes>include,omitempty"` // File patterns explicitly included
Excludes []string `xml:"excludes>exclude,omitempty"` // File patterns explicitly excluded
}
FilterConfig describes the filter configuration used to generate this output (PTX v2.0)
type Formatter ¶
type Formatter interface {
Format(project *ProjectOutput) (string, error)
}
Formatter interface for different output formats
func GetFormatter ¶
Get appropriate formatter based on format string
type JSONLFormatter ¶ added in v0.5.0
type JSONLFormatter struct{} // JSONL - Machine-friendly sidecar format (one JSON object per line)
func (*JSONLFormatter) Format ¶ added in v0.5.0
func (j *JSONLFormatter) Format(project *ProjectOutput) (string, error)
JSONLFormatter implements machine-friendly JSONL output (one JSON object per line) This format is ideal for programmatic processing, streaming, and pipeline integration
type MarkdownFormatter ¶
type MarkdownFormatter struct{}
func (*MarkdownFormatter) Format ¶
func (m *MarkdownFormatter) Format(project *ProjectOutput) (string, error)
type OutputFormat ¶
type OutputFormat string
const ( FormatMarkdown OutputFormat = "markdown" FormatXML OutputFormat = "xml" FormatPTX OutputFormat = "ptx" // PTX v2.0 (TOON-based with multiline code and enhanced manifest) FormatTOON OutputFormat = "toon" // Alias for PTX (backward compatibility) FormatTOONStrict OutputFormat = "toon-strict" // TOON v1.3 strict compliance FormatTOONV13 OutputFormat = "toon-v1.3" // Alias for toon-strict FormatJSONL OutputFormat = "jsonl" // JSONL - machine-friendly sidecar format )
type PTXFormatter ¶ added in v0.4.2
type PTXFormatter struct{} // PTX v2.0 - TOON-based with multiline code and enhanced manifest
func (*PTXFormatter) Format ¶ added in v0.4.2
func (t *PTXFormatter) Format(project *ProjectOutput) (string, error)
PTXFormatter formats project data in PTX v2.0 format (TOON-based with multiline code and enhanced manifest)
type ProjectAnalysis ¶
type ProjectAnalysis struct {
EntryPoints map[string]string `xml:"entryPoints,omitempty"`
ConfigFiles map[string]string `xml:"configFiles,omitempty"`
CoreFiles map[string]string `xml:"coreFiles,omitempty"`
TestFiles map[string]string `xml:"testFiles,omitempty"`
Documentation map[string]string `xml:"documentation,omitempty"`
}
type ProjectOutput ¶
type ProjectOutput struct {
XMLName xml.Name `xml:"project"`
DirectoryTree *DirectoryNode `xml:"directoryTree"`
GitInfo *GitInfo `xml:"gitInfo,omitempty"`
Metadata *Metadata `xml:"metadata,omitempty"`
Files []FileInfo `xml:"files>file,omitempty"`
Overview *ProjectOverview `xml:"overview,omitempty"`
FileStats *FileStatistics `xml:"fileStats,omitempty"`
Dependencies *DependencyInfo `xml:"dependencies,omitempty"`
Analysis *ProjectAnalysis `xml:"analysis,omitempty"`
Budget *BudgetInfo `xml:"budget,omitempty"` // PTX v2.0: Token budget tracking
FilterConfig *FilterConfig `xml:"filterConfig,omitempty"` // PTX v2.0: Filter configuration used
}
type ProjectOverview ¶
type TOONEncoder ¶ added in v0.4.0
type TOONEncoder struct {
// contains filtered or unexported fields
}
TOONEncoder encodes Go values to TOON format
func NewTOONEncoder ¶ added in v0.4.0
func NewTOONEncoder() *TOONEncoder
NewTOONEncoder creates a new TOON encoder
func (*TOONEncoder) Encode ¶ added in v0.4.0
func (e *TOONEncoder) Encode(v interface{}) (string, error)
Encode encodes a Go value to TOON format string
type TOONStrictFormatter ¶ added in v0.4.2
type TOONStrictFormatter struct{} // TOON v1.3 strict compliance
func (*TOONStrictFormatter) Format ¶ added in v0.4.2
func (t *TOONStrictFormatter) Format(project *ProjectOutput) (string, error)
TOONStrictFormatter implements TOON v1.3 strict compliance This formatter follows the official TOON specification exactly, using escaped strings for code content instead of multiline blocks.
type TruncationInfo ¶ added in v0.5.0
type TruncationInfo struct {
Mode string `xml:"mode"` // Truncation mode (e.g., "head:300,tail:53")
OriginalTokens int `xml:"originalTokens"` // Token count before truncation
}
TruncationInfo describes how a file was truncated (PTX v2.0)
type XMLFormatter ¶
type XMLFormatter struct{}
func (*XMLFormatter) Format ¶
func (x *XMLFormatter) Format(project *ProjectOutput) (string, error)