Documentation
¶
Index ¶
- Constants
- Variables
- func ExtractAssistantContent(line []byte) string
- func ExtractLastAssistantMessage(path string, maxChars int) (string, error)
- func ExtractLastAssistantMessageAfterLastUser(path string, maxChars int) (string, error)
- func ExtractLastAssistantMessageAfterLastUserSince(path string, maxChars int, minAssistantTimestamp time.Time) (string, error)
- func FindArchivedCodexTranscript(resumeID string) string
- func FindClaudeTranscript(sessionID string) string
- func FindCodexTranscript(cwd string, startedAt time.Time) string
- func FindCodexTranscriptForResume(resumeID string) string
- func FindCopilotLaunchTranscript(cwd string, launchedAt time.Time, claimed func(conversationID string) bool) string
- func FindCopilotTranscript(cwd string, startedAt time.Time) string
- func FindCopilotTranscriptForResume(resumeID string) string
- func HeadCursor(path string) (string, error)
- func RedactText(text string) string
- func ResolveCodexRolloutPath(path string) string
- func SupportsUsage(agent string) bool
- type AssistantMessage
- type AssistantTurn
- type AssistantWindow
- type AssistantWindowLimits
- type AssistantWindowReport
- type ConversationSlice
- type CopilotToolLifecycle
- type Event
- type EventPage
- type FollowBatch
- type FollowRecord
- type Follower
- type SliceOptions
- type TokenUsage
- type TurnAbort
- type UsageExtractor
- type UsageSource
- type UsageSourceResolver
Constants ¶
View Source
const ( EventKindUser = "user" EventKindAssistant = "assistant" EventKindThinking = "thinking" EventKindToolCall = "tool_call" EventKindToolResult = "tool_result" EventKindError = "error" )
Variables ¶
Functions ¶
func ExtractAssistantContent ¶
func ExtractLastAssistantMessageAfterLastUser ¶ added in v0.2.7
func ExtractLastAssistantMessageAfterLastUserSince ¶ added in v0.2.7
func FindArchivedCodexTranscript ¶ added in v0.13.0
func FindClaudeTranscript ¶
func FindCodexTranscriptForResume ¶ added in v0.12.0
func FindCopilotLaunchTranscript ¶ added in v0.12.0
func FindCopilotTranscriptForResume ¶ added in v0.3.0
func HeadCursor ¶ added in v0.12.0
func RedactText ¶ added in v0.12.0
func ResolveCodexRolloutPath ¶ added in v0.13.0
func SupportsUsage ¶ added in v0.12.0
Types ¶
type AssistantMessage ¶ added in v0.12.0
type AssistantTurn ¶ added in v0.2.7
func ExtractLastAssistantTurnAfterLastUserSince ¶ added in v0.2.7
func ExtractLastAssistantTurnAfterLastUserSince(path string, maxChars int, minAssistantTimestamp time.Time) (AssistantTurn, error)
ExtractLastAssistantTurnAfterLastUserSince reads back from the end to the last user or assistant entry: a user entry there means the latest turn has no reply yet.
type AssistantWindow ¶ added in v0.12.0
type AssistantWindow struct {
// contains filtered or unexported fields
}
func NewAssistantWindow ¶ added in v0.12.0
func NewAssistantWindow(limits AssistantWindowLimits) *AssistantWindow
func (*AssistantWindow) Apply ¶ added in v0.12.0
func (w *AssistantWindow) Apply(events []Event) bool
func (*AssistantWindow) MarkPrefixOmitted ¶ added in v0.12.0
func (w *AssistantWindow) MarkPrefixOmitted()
func (*AssistantWindow) Snapshot ¶ added in v0.12.0
func (w *AssistantWindow) Snapshot() ([]AssistantMessage, AssistantWindowReport)
type AssistantWindowLimits ¶ added in v0.12.0
type AssistantWindowReport ¶ added in v0.12.0
type AssistantWindowReport struct {
DroppedOversize int
LargestDropped int
DroppedOld int
OmittedPrefix bool
}
func (AssistantWindowReport) Truncated ¶ added in v0.12.0
func (r AssistantWindowReport) Truncated() bool
type ConversationSlice ¶ added in v0.12.0
type ConversationSlice struct {
Brief string
Rescoping []string
Summary string
AgentTurns []string
HumanCount int
AgentCount int
}
func ExtractConversationSlice ¶ added in v0.12.0
func ExtractConversationSlice(path string, opts SliceOptions) (ConversationSlice, error)
func (ConversationSlice) Empty ¶ added in v0.12.0
func (s ConversationSlice) Empty() bool
func (ConversationSlice) Render ¶ added in v0.12.0
func (s ConversationSlice) Render() string
type CopilotToolLifecycle ¶ added in v0.2.7
func ExtractCopilotToolLifecycle ¶ added in v0.2.7
func ExtractCopilotToolLifecycle(line []byte) (CopilotToolLifecycle, bool)
type Event ¶ added in v0.12.0
type Event struct {
Cursor string `json:"cursor"`
Timestamp string `json:"timestamp,omitempty"`
Kind string `json:"kind"`
Role string `json:"role,omitempty"`
Text string `json:"text,omitempty"`
ToolName string `json:"tool_name,omitempty"`
ToolCallID string `json:"tool_call_id,omitempty"`
IsError bool `json:"is_error,omitempty"`
}
type FollowBatch ¶ added in v0.12.0
type FollowBatch struct {
Records []FollowRecord
Events []Event
Usage []TokenUsage
}
type FollowRecord ¶ added in v0.12.0
type FollowRecord struct {
Raw []byte
Events []Event
Usage *TokenUsage
}
type Follower ¶ added in v0.12.0
type Follower struct {
// contains filtered or unexported fields
}
func NewFollower ¶ added in v0.12.0
func NewFollowerAfterCursor ¶ added in v0.12.0
func (*Follower) Read ¶ added in v0.12.0
func (f *Follower) Read() (FollowBatch, error)
type SliceOptions ¶ added in v0.12.0
type SliceOptions struct {
MaxRescopingTurns int
MaxAgentTurns int
TurnCharCap int
SummaryCharCap int
}
func DefaultSliceOptions ¶ added in v0.12.0
func DefaultSliceOptions() SliceOptions
type TokenUsage ¶ added in v0.12.0
type TokenUsage struct {
Key string
Model string
Purpose string
FastMode bool
InputTokens int64
OutputTokens int64
CacheWrite5mTokens int64
CacheWrite1hTokens int64
CacheWriteUnclassifiedTokens int64
CacheReadTokens int64
ReportedCostUSD float64
}
func (TokenUsage) HasTokens ¶ added in v0.12.0
func (u TokenUsage) HasTokens() bool
type TurnAbort ¶ added in v0.12.0
func ClaudeTurnAborted ¶ added in v0.12.0
func CodexTurnAborted ¶ added in v0.12.0
func CopilotTurnAborted ¶ added in v0.12.0
type UsageExtractor ¶ added in v0.12.0
type UsageExtractor struct {
// contains filtered or unexported fields
}
func NewUsageExtractor ¶ added in v0.12.0
func NewUsageExtractor(agent string) *UsageExtractor
func (*UsageExtractor) Observe ¶ added in v0.12.0
func (e *UsageExtractor) Observe(line []byte, sourceKey string) (TokenUsage, bool)
type UsageSource ¶ added in v0.12.0
type UsageSourceResolver ¶ added in v0.12.0
type UsageSourceResolver interface {
Discover() ([]UsageSource, error)
}
func NewClaudeUsageSourceResolver ¶ added in v0.12.0
func NewClaudeUsageSourceResolver(rootPath string) UsageSourceResolver
func NewCodexUsageSourceResolver ¶ added in v0.12.0
func NewCodexUsageSourceResolver(rootPath string) UsageSourceResolver
func NewReportedUsageSourceResolver ¶ added in v0.12.0
func NewReportedUsageSourceResolver(rootPath string) UsageSourceResolver
Click to show internal directories.
Click to hide internal directories.