checkpoint

package
v2026.708.0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bump

func Bump(s *chatstore.Session) int

func FormatCheckpointContinuationPlain added in v2026.613.0

func FormatCheckpointContinuationPlain(cpSeq int, branch string) string

FormatCheckpointContinuationPlain returns continuation dots whose count matches FormatCheckpointTag width (including brackets), plus a trailing space.

func FormatCheckpointPrefix

func FormatCheckpointPrefix(cpSeq int, branch string) string

func FormatCheckpointTag

func FormatCheckpointTag(cpSeq int, branch string) string

func FormatLinePrefix

func FormatLinePrefix(cpSeq int, branch string) string

func FormatReplPromptPrefix

func FormatReplPromptPrefix(s *chatstore.Session) string

func NextForkSuffix

func NextForkSuffix(s *chatstore.Session, forkAtDisplay int) string

func PruneForkChildCount added in v2026.621.0

func PruneForkChildCount(m map[int]int, from int) map[int]int

func ResolveSessionGoto added in v2026.621.0

func ResolveSessionGoto(s *chatstore.Session, id *FullCheckpointID) (messages []chatstore.Message, branches []chatstore.BranchSegment, err error)

ResolveSessionGoto computes the active transcript and stored branch segments after jumping to id. It searches both the live branch and Branches so earlier truncated checkpoints remain reachable.

func SkipStagingIfRunningExecutable

func SkipStagingIfRunningExecutable(abs string) bool

func SplitAtFullID

func SplitAtFullID(msgs []chatstore.Message, id *FullCheckpointID) (keep, drop []chatstore.Message, err error)

SplitAtFullID splits messages at the first message whose CheckpointSeq and CheckpointBranchKey match the given FullCheckpointID exactly. An empty suffix matches only messages on the main branch (CheckpointBranchKey == ""). Tags printed on tool invocations (separate Bump per tool) are stored on ToolCalls; those match here via the parent assistant message index.

func SplitAtInclusiveDisplay

func SplitAtInclusiveDisplay(msgs []chatstore.Message, displayN int) (keep, drop []chatstore.Message, err error)

func StampMsg

func StampMsg(m *chatstore.Message, s *chatstore.Session, seq int)

Types

type FullCheckpointID

type FullCheckpointID struct {
	Seq    int
	Suffix string
	Raw    string
}

func ParseFullCheckpointID

func ParseFullCheckpointID(raw string) (*FullCheckpointID, error)

type RewindPlan added in v2026.621.0

type RewindPlan struct {
	Target            *FullCheckpointID
	Messages          []chatstore.Message
	Branches          []chatstore.BranchSegment
	DroppedMsgs       int
	RemovedBranches   int
	RemovedBranchMsgs int
}

func PlanSessionRewind added in v2026.621.0

func PlanSessionRewind(s *chatstore.Session, id *FullCheckpointID) (*RewindPlan, error)

PlanSessionRewind prepares a destructive rewind to id on the active branch only. Messages after id and every stored branch forked at id or later are dropped.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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