copilot

package
v0.80.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2026 License: MIT Imports: 13 Imported by: 0

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

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 New

func New() *Adapter

New creates a new GitHub Copilot CLI adapter.

func (*Adapter) Capabilities

func (a *Adapter) Capabilities() adapter.CapabilitySet

Capabilities returns the supported features.

func (*Adapter) Detect

func (a *Adapter) Detect(projectRoot string) (bool, error)

Detect checks if Copilot CLI sessions exist for the given project.

func (*Adapter) ID

func (a *Adapter) ID() string

ID returns the adapter identifier.

func (*Adapter) Icon

func (a *Adapter) Icon() string

Icon returns the adapter icon for badge display.

func (*Adapter) Messages

func (a *Adapter) Messages(sessionID string) ([]adapter.Message, error)

Messages returns all messages for the given session.

func (*Adapter) Name

func (a *Adapter) Name() string

Name returns the human-readable adapter name.

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

func (a *Adapter) Sessions(projectRoot string) ([]adapter.Session, error)

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

func (a *Adapter) Watch(projectRoot string) (<-chan adapter.Event, io.Closer, error)

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

Jump to

Keyboard shortcuts

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