Documentation
¶
Overview ¶
Package copilot provides an adapter for GitHub Copilot CLI that parses workspace.yaml metadata and events.jsonl session files to display conversations and tool usage.
Index ¶
- type Adapter
- func (a *Adapter) Capabilities() adapter.CapabilitySet
- func (a *Adapter) Detect(projectRoot string) (bool, error)
- func (a *Adapter) ID() string
- func (a *Adapter) Icon() string
- func (a *Adapter) Messages(sessionID string) ([]adapter.Message, error)
- func (a *Adapter) Name() string
- func (a *Adapter) SearchMessages(sessionID, query string, opts adapter.SearchOptions) ([]adapter.MessageMatch, error)
- func (a *Adapter) Sessions(projectRoot string) ([]adapter.Session, error)
- func (a *Adapter) Usage(sessionID string) (*adapter.UsageStats, error)
- func (a *Adapter) Watch(projectRoot string) (<-chan adapter.Event, io.Closer, error)
- func (a *Adapter) WatchScope() adapter.WatchScope
- type CopilotEvent
- type WorkspaceYAML
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter implements the adapter.Adapter interface for GitHub Copilot CLI sessions.
func (*Adapter) Capabilities ¶
func (a *Adapter) Capabilities() adapter.CapabilitySet
Capabilities returns the supported features.
func (*Adapter) SearchMessages ¶
func (a *Adapter) SearchMessages(sessionID, query string, opts adapter.SearchOptions) ([]adapter.MessageMatch, error)
SearchMessages searches message content within a session. Implements adapter.MessageSearcher interface.
func (*Adapter) Sessions ¶
Sessions returns all sessions for the given project, sorted by update time.
func (*Adapter) Usage ¶
func (a *Adapter) Usage(sessionID string) (*adapter.UsageStats, error)
Usage returns usage statistics for the session. Note: Copilot CLI doesn't expose token usage in events, so this returns empty stats.
func (*Adapter) Watch ¶
Watch watches for changes to Copilot CLI sessions. Since Copilot sessions are global, this watches all session directories but filters events by projectRoot.
func (*Adapter) WatchScope ¶
func (a *Adapter) WatchScope() adapter.WatchScope
WatchScope returns global since Copilot sessions are stored globally in ~/.copilot
type CopilotEvent ¶
type CopilotEvent struct {
Type string `json:"type"`
Data map[string]interface{} `json:"data"`
ID string `json:"id"`
Timestamp time.Time `json:"timestamp"`
ParentID *string `json:"parentId"`
}
CopilotEvent represents a single event from events.jsonl
type WorkspaceYAML ¶
type WorkspaceYAML struct {
ID string `yaml:"id"`
CWD string `yaml:"cwd"`
GitRoot string `yaml:"git_root"`
Branch string `yaml:"branch"`
Summary string `yaml:"summary"`
SummaryCount int `yaml:"summary_count"`
CreatedAt time.Time `yaml:"created_at"`
UpdatedAt time.Time `yaml:"updated_at"`
}
WorkspaceYAML represents the workspace.yaml metadata