copilot

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const ProviderName = "copilot"

Variables

This section is empty.

Functions

func ExtractCWDFromWorkspace

func ExtractCWDFromWorkspace(data []byte) string

ExtractCWDFromWorkspace reads the cwd field from workspace.yaml data.

func ExtractModelFromLine

func ExtractModelFromLine(line string) string

ExtractModelFromLine extracts the LLM model name from a JSONL line.

func ExtractSessionID

func ExtractSessionID(transcriptRef string) string

ExtractSessionID extracts the UUID session ID from a Copilot transcript path.

func SerializeToolUses

func SerializeToolUses(tus []ToolUse, contentTypes []string) sql.NullString

SerializeToolUses returns tool uses and content types as a JSON NullString.

func Truncate

func Truncate(s string, max int) string

Truncate trims and limits a string to max characters.

Types

type ParsedLine

type ParsedLine = parsedLine

ParsedLine aliases parsedLine for hook integration.

func ParseLine

func ParseLine(line string) ParsedLine

ParseLine parses a single Copilot JSONL line and returns structured fields.

type SessionTokens

type SessionTokens struct {
	InputTokens      int64
	OutputTokens     int64
	CacheReadTokens  int64
	CacheWriteTokens int64
	APICallCount     int
}

SessionTokens holds session-level token aggregates from session.shutdown.

func ExtractSessionShutdownTokens

func ExtractSessionShutdownTokens(line string) *SessionTokens

ExtractSessionShutdownTokens extracts aggregate token usage from a session.shutdown JSONL line. Returns nil if not a shutdown event.

type ToolUse

type ToolUse = toolUse

ToolUse aliases toolUse for hook integration.

Jump to

Keyboard shortcuts

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