Documentation
¶
Overview ¶
Package dotdir manages the .tapes/ and ~/.tapes directories.
The checkout state represents a point in a conversation DAG that the user has "checked out" for resuming chat sessions. The state is persisted as a JSON file in the ~/.tapes/ directory.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CheckoutMessage ¶
CheckoutMessage represents a single message in the checked-out conversation.
type CheckoutState ¶
type CheckoutState struct {
// Hash is the hash of the checked-out node.
Hash string `json:"hash"`
// Messages is the conversation history in chronological order
// (oldest first), up to and including the checked-out node.
Messages []CheckoutMessage `json:"messages"`
}
CheckoutState represents the persisted checkout state. It contains the hash of the checked-out node and the conversation messages leading up to (and including) that node.
type Manager ¶
type Manager struct{}
func NewManager ¶
func NewManager() *Manager
func (*Manager) ClearCheckout ¶
ClearCheckout removes the checkout state file. This resets the state so the next chat session starts a new root conversation. If overrideDir is non-empty, it is used instead of the default ~/.tapes/ location. Returns nil if the file doesn't exist (already cleared).
func (*Manager) LoadCheckoutState ¶
func (m *Manager) LoadCheckoutState(overrideDir string) (*CheckoutState, error)
LoadCheckoutState loads the checkout state from a target .tapes/checkout.json. Returns nil, nil if no checkout state exists (empty/new conversation state). If overrideDir is non-empty, it is used instead of the default ~/.tapes/ location.
func (*Manager) SaveCheckout ¶
func (m *Manager) SaveCheckout(state *CheckoutState, overrideDir string) error
SaveCheckout persists the checkout state to a target .tapes/checkout.json.