tools

package
v0.0.0-...-cc74e3f Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

func ExtractFrontmatter(content, field string) string

ExtractFrontmatter extracts a field from YAML frontmatter.

func FindSkillTool

func FindSkillTool() copilot.Tool

FindSkillTool searches the open skills ecosystem.

func InstallSkillTool

func InstallSkillTool() copilot.Tool

InstallSkillTool installs a skill from the ecosystem.

func LoadSkillTool

func LoadSkillTool(dataDir string) copilot.Tool

LoadSkillTool reads an installed skill's SKILL.md.

func Redact

func Redact(path string) string

Redact replaces home dir with ~ when redaction is enabled. Exported for use by other packages.

func RunCommandTool

func RunCommandTool(timeout time.Duration) copilot.Tool

RunCommandTool executes shell commands with a timeout.

func SetRedact

func SetRedact(enabled bool)

SetRedact enables/disables home directory path redaction in tool output.

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 NewUsageTracker

func NewUsageTracker() *UsageTracker

NewUsageTracker creates a new tracker.

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.

Jump to

Keyboard shortcuts

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