Documentation
¶
Overview ¶
Package copilot reads `copilot -p --output-format json` runs of GitHub Copilot CLI.
The stream carries no token counts. The session's events.jsonl, which Copilot CLI writes under its home, holds one session.usage_record per model request and one session.shutdown with each model's totals. The plan names the session, so the budget is watched in that file during the run. The rows come from the usage records, and the shutdown's totals check them.
Index ¶
Constants ¶
const Name = "copilot"
Name is the costroid/agent tag.
const UnitNanoAIU = "nano-AIU"
UnitNanoAIU is Copilot's own unit for its AI credits: nano-AI units, as totalNanoAiu states them.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent struct{}
Agent is Copilot CLI.
func (Agent) NewSession ¶
NewSession starts reading a run of the planned command.
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session reads one Copilot CLI run. Feed and Tail run on separate goroutines, so the lock covers everything below it.
func (*Session) Feed ¶
Feed reads one stdout line. Only the result line is read: it names the session.