Documentation
¶
Index ¶
- func AssistantDisplayParts(m Message) (reasoning string, visibleContent string)
- func BackfillAssistantUsageFromTextIfEmpty(m *Message, prior []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 ReconcileCheckpointLast(s *Session)
- func RemoveBrokenSessionImageFiles(s *Session) int
- func RemoveSessionPath(projectHex, chatID string) error
- func RenameSessionFile(projectHex, oldID, newID string) error
- func RepairSessionMalformedImages(s *Session) (brokenDropped int, userMsgsAdjusted int, emptyRewrites int)
- func RewriteEmptyUserMsgsAfterImageRepair(s *Session) int
- func SessionPath(projectHex, chatIDHex string) (string, error)
- 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 WriteSession(projectHex string, s *Session) error
- type MainOrphanSegment
- type Message
- type Session
- type ToolCall
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssistantDisplayParts ¶
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 ReconcileCheckpointLast ¶
func ReconcileCheckpointLast(s *Session)
func RemoveSessionPath ¶
func RenameSessionFile ¶
func SessionPath ¶
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"`
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"`
}
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"`
LegacyTools bool `json:"legacy_tools,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.