Documentation
¶
Index ¶
- Variables
- func EmitUsage(event copilot.SessionEvent)
- func ExtractFrontmatter(content, field string) string
- func FindSkillTool() copilot.Tool
- func InstallSkillTool() copilot.Tool
- func LoadSkillTool(dataDir string) copilot.Tool
- func Redact(path string) string
- func RunCommandTool(timeout time.Duration) copilot.Tool
- func SetRedact(enabled bool)
- type AgentUsage
- type UsageTracker
Constants ¶
This section is empty.
Variables ¶
var GlobalTracker = NewUsageTracker()
GlobalTracker is the shared usage tracker for all pipeline agents.
Functions ¶
func EmitUsage ¶
func EmitUsage(event copilot.SessionEvent)
EmitUsage is the legacy JSON emitter — kept for --verbose mode only.
func ExtractFrontmatter ¶
ExtractFrontmatter extracts a field from YAML frontmatter.
func FindSkillTool ¶
FindSkillTool searches the open skills ecosystem.
func InstallSkillTool ¶
InstallSkillTool installs a skill from the ecosystem.
func LoadSkillTool ¶
LoadSkillTool reads an installed skill's SKILL.md.
func Redact ¶
Redact replaces home dir with ~ when redaction is enabled. Exported for use by other packages.
func RunCommandTool ¶
RunCommandTool executes shell commands with a timeout.
Types ¶
type AgentUsage ¶
type AgentUsage struct {
InputTokens float64
OutputTokens float64
CacheReadTokens float64
CacheWriteTokens float64
Requests float64
PremiumRequests float64
DurationMS float64
}
AgentUsage tracks accumulated token usage for a single agent phase.
type UsageTracker ¶
type UsageTracker struct {
// contains filtered or unexported fields
}
UsageTracker accumulates token usage across all pipeline agents.
func (*UsageTracker) PrintSummary ¶
func (t *UsageTracker) PrintSummary()
PrintSummary prints a formatted usage summary to stderr.
func (*UsageTracker) Track ¶
func (t *UsageTracker) Track(phase string, event copilot.SessionEvent)
Track records a usage event for a phase.