Documentation
¶
Index ¶
- Constants
- func ExtractCWDFromWorkspace(data []byte) string
- func ExtractModelFromLine(line string) string
- func ExtractSessionID(transcriptRef string) string
- func SerializeToolUses(tus []ToolUse, contentTypes []string) sql.NullString
- func Truncate(s string, max int) string
- type ParsedLine
- type SessionTokens
- type ToolUse
Constants ¶
View Source
const ProviderName = "copilot"
Variables ¶
This section is empty.
Functions ¶
func ExtractCWDFromWorkspace ¶
ExtractCWDFromWorkspace reads the cwd field from workspace.yaml data.
func ExtractModelFromLine ¶
ExtractModelFromLine extracts the LLM model name from a JSONL line.
func ExtractSessionID ¶
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.
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.
Click to show internal directories.
Click to hide internal directories.