Documentation
¶
Index ¶
- func ApplyTurnUsageDisplayToLastAssistant(s *Session, ctxTok, usrTok int64, ctxEst bool, ...)
- func AssistantDisplayParts(m Message) (reasoning string, visibleContent string)
- func BackfillAssistantUsageFromTextIfEmpty(m *Message, prior []Message)
- func BackfillSessionAssistantUsage(msgs []Message)
- func ChatIDHex(title string, ts time.Time) string
- func ChatsDir(projectHex string) (string, error)
- func FinishSessionLoad(s *Session)
- func IsPlaceholderChatID(id string) bool
- func MessageCheckpointTagVisible(m Message) bool
- func MigrateImagePathsAfterChatRename(projectHex string, s *Session, oldChatID, newChatID string) error
- func MigrateLegacyCheckpointsToBase0(s *Session)
- func NewPlaceholderChatID(t time.Time) string
- func PlansDir(projectHex string) (string, error)
- func ProjectWelcomeStats(projectHex string) (chatCount int, userSum, reasonSum, respSum int64, err error)
- func PruneUnreferencedSessionImages(s *Session)
- func RebuildProjectStats(projectHex string) error
- func ReconcileCheckpointLast(s *Session)
- func RemoveBrokenSessionImageFiles(s *Session) int
- func RemoveSessionPath(projectHex, chatID string) error
- func RenameSessionFile(projectHex, oldID, newID string) (err error)
- func RepairSessionMalformedImages(s *Session) (brokenDropped int, userMsgsAdjusted int, emptyRewrites int)
- func RewriteEmptyUserMsgsAfterImageRepair(s *Session) int
- func SessionPath(projectHex, chatIDHex string) (string, error)
- func StoredUsageLineForTurnRange(msgs []Message, start, end int) (contextTok, lastUserTok, reasoningTok, responseTok, totalTok int64, ...)
- func StripAllImgPlaceholders(content string) string
- func StripImgPlaceholderTags(content string) string
- func StripStaleUserImgPlaceholdersFromSession(s *Session) int
- func StripUnresolvedImgPlaceholders(content string, imageFiles map[int]string) string
- func SubchatPath(projectHex, idHex string) (string, error)
- func SubchatsDir(projectHex string) (string, error)
- func TempDir(projectHex string) (string, error)
- func TouchProjectStatsAfterRemove(projectHex, chatID string) error
- func TouchProjectStatsAfterRename(projectHex, oldID, newID string) error
- func WriteSession(projectHex string, s *Session) (err error)
- type MainOrphanSegment
- type Message
- type Session
- type ToolCall
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssistantDisplayParts ¶
func BackfillSessionAssistantUsage ¶
func BackfillSessionAssistantUsage(msgs []Message)
func FinishSessionLoad ¶
func FinishSessionLoad(s *Session)
func IsPlaceholderChatID ¶
func MigrateLegacyCheckpointsToBase0 ¶
func MigrateLegacyCheckpointsToBase0(s *Session)
func NewPlaceholderChatID ¶
func ProjectWelcomeStats ¶
func PruneUnreferencedSessionImages ¶
func PruneUnreferencedSessionImages(s *Session)
func RebuildProjectStats ¶
func ReconcileCheckpointLast ¶
func ReconcileCheckpointLast(s *Session)
func RemoveSessionPath ¶
func RenameSessionFile ¶
func SessionPath ¶
func StoredUsageLineForTurnRange ¶
func StoredUsageLineForTurnRange(msgs []Message, start, end int) (contextTok, lastUserTok, reasoningTok, responseTok, totalTok int64, outputTPS, ttftSecs, promptTPS, turnWallSecs float64, contextEstimated bool, ok bool)
StoredUsageLineForTurnRange returns the usage line fields shown live at end of a user turn.
func StripAllImgPlaceholders ¶
func StripImgPlaceholderTags ¶
func SubchatPath ¶
func SubchatsDir ¶
func WriteSession ¶
Types ¶
type MainOrphanSegment ¶
type Message ¶
type Message struct {
Role string `json:"role"`
Content string `json:"content"`
APIContent string `json:"api_content,omitempty"`
ToolCallID string `json:"tool_call_id,omitempty"`
ToolCalls []ToolCall `json:"tool_calls,omitempty"`
ReasoningText string `json:"reasoning_text,omitempty"`
CheckpointSeq int `json:"cp_seq,omitempty"`
CpSeqSet bool `json:"cp_set,omitempty"`
CheckpointBranchKey string `json:"cp_branch,omitempty"`
CommitOID string `json:"commit_oid,omitempty"`
UserPromptTokens int64 `json:"user_prompt_tokens"`
ReasoningTokens int64 `json:"reasoning_tokens"`
ResponseTokens int64 `json:"response_tokens"`
TurnTotalTokens int64 `json:"turn_total_tokens"`
PromptTokens int64 `json:"prompt_tokens,omitempty"`
CachedPromptTokens int64 `json:"cached_prompt_tokens,omitempty"`
OutputTPS float64 `json:"output_tps,omitempty"`
TTFTSecs float64 `json:"ttft_secs,omitempty"`
PromptTPS float64 `json:"prompt_tps,omitempty"`
TurnWallSecs float64 `json:"turn_wall_secs,omitempty"`
TurnDisplaySaved bool `json:"turn_display_saved,omitempty"`
TurnContextTokens int64 `json:"turn_context_tokens,omitempty"`
TurnContextEst bool `json:"turn_context_est,omitempty"`
TurnUserTokens int64 `json:"turn_user_tokens,omitempty"`
TurnReasonTokens int64 `json:"turn_reason_tokens,omitempty"`
TurnRespTokens int64 `json:"turn_resp_tokens,omitempty"`
TurnTotalDisplay int64 `json:"turn_total_display,omitempty"`
TurnOutputTPS float64 `json:"turn_output_tps,omitempty"`
TurnTTFTSecs float64 `json:"turn_ttft_secs,omitempty"`
TurnPromptTPS float64 `json:"turn_prompt_tps,omitempty"`
TurnWallDisplay float64 `json:"turn_wall_display_secs,omitempty"`
}
type Session ¶
type Session struct {
ID string `json:"id"`
Title string `json:"title"`
CreatedAt time.Time `json:"created_at"`
LastMessageAt time.Time `json:"last_message_at"`
LastUserMessageAt time.Time `json:"last_user_message_at,omitempty"`
Messages []Message `json:"messages"`
CheckpointLast int `json:"checkpoint_last"`
CheckpointCP0 bool `json:"cp0,omitempty"`
CheckpointBranchSuffix string `json:"cp_branch_suffix,omitempty"`
ForkChildCount map[int]int `json:"fork_child_count,omitempty"`
MainOrphans []MainOrphanSegment `json:"main_orphans,omitempty"`
LastCommitOID string `json:"last_commit_oid,omitempty"`
ImageSeq int `json:"image_seq,omitempty"`
ImageFiles map[int]string `json:"image_files,omitempty"`
ActivatedInstructionDirs []string `json:"activated_instruction_dirs,omitempty"`
}
func FindByTitle ¶
func ReadSession ¶
Click to show internal directories.
Click to hide internal directories.