store

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package store provides filesystem reference implementations of the core memory seams: a durable per-thread history store and a workspace bootstrap loader. These are the OSS defaults; distributions may supply remote stores.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTaskStateStore

func NewTaskStateStore(stateDir string) *taskstate.FileStore

Types

type FileStore

type FileStore struct {
	// contains filtered or unexported fields
}

FileStore is a filesystem-backed HistoryStore + bootstrap.Loader. Thread history is one JSON file per thread under stateDir/history; bootstrap files are read from the workspace root.

func NewFileStore

func NewFileStore(workspaceRoot, stateDir string) *FileStore

NewFileStore returns a store rooted at workspaceRoot (bootstrap files) with history persisted under stateDir.

func (*FileStore) DeleteHistory

func (s *FileStore) DeleteHistory(_ context.Context, threadID string) error

DeleteHistory deletes the persisted transcript for threadID.

func (*FileStore) DeleteWorkspaceHistory added in v0.0.2

func (s *FileStore) DeleteWorkspaceHistory(_ context.Context, workspaceID, threadID string) error

DeleteWorkspaceHistory deletes the transcript stored under the composite (workspaceID, threadID).

func (*FileStore) ListWorkspaceHistory added in v0.0.2

func (s *FileStore) ListWorkspaceHistory(_ context.Context, workspaceID string) ([]ThreadHistory, error)

ListWorkspaceHistory returns every non-empty transcript in workspaceID, sorted by thread ID. It supports export and administrative surfaces without making callers understand the filesystem-safe ID encoding.

func (*FileStore) LoadBootstrap

func (s *FileStore) LoadBootstrap(_ context.Context) ([]bootstrap.File, error)

LoadBootstrap reads the workspace bootstrap documents (in bootstrapFileOrder) that exist, each capped at maxBootstrap bytes.

func (*FileStore) LoadHistory

func (s *FileStore) LoadHistory(_ context.Context, threadID string) ([]protocol.ChatMessage, error)

LoadHistory returns the thread's persisted messages (empty if none).

func (*FileStore) LoadWorkspaceHistory added in v0.0.2

func (s *FileStore) LoadWorkspaceHistory(_ context.Context, workspaceID, threadID string) ([]protocol.ChatMessage, error)

LoadWorkspaceHistory returns the transcript stored under the composite (workspaceID, threadID), isolated from both legacy and other workspace data.

func (*FileStore) SaveHistory

func (s *FileStore) SaveHistory(_ context.Context, threadID string, messages []protocol.ChatMessage) error

SaveHistory atomically writes the thread's messages.

func (*FileStore) SaveWorkspaceHistory added in v0.0.2

func (s *FileStore) SaveWorkspaceHistory(_ context.Context, workspaceID, threadID string, messages []protocol.ChatMessage) error

SaveWorkspaceHistory atomically writes a transcript under the composite (workspaceID, threadID).

type ThreadHistory added in v0.0.2

type ThreadHistory struct {
	ThreadID string
	Messages []protocol.ChatMessage
}

ThreadHistory is one workspace-scoped transcript returned for enumeration.

Jump to

Keyboard shortcuts

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