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 ¶
- func NewTaskStateStore(stateDir string) *taskstate.FileStore
- type FileStore
- func (s *FileStore) DeleteHistory(_ context.Context, threadID string) error
- func (s *FileStore) DeleteWorkspaceHistory(_ context.Context, workspaceID, threadID string) error
- func (s *FileStore) ListWorkspaceHistory(_ context.Context, workspaceID string) ([]ThreadHistory, error)
- func (s *FileStore) LoadBootstrap(_ context.Context) ([]bootstrap.File, error)
- func (s *FileStore) LoadHistory(_ context.Context, threadID string) ([]protocol.ChatMessage, error)
- func (s *FileStore) LoadWorkspaceHistory(_ context.Context, workspaceID, threadID string) ([]protocol.ChatMessage, error)
- func (s *FileStore) SaveHistory(_ context.Context, threadID string, messages []protocol.ChatMessage) error
- func (s *FileStore) SaveWorkspaceHistory(_ context.Context, workspaceID, threadID string, ...) error
- type ThreadHistory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewTaskStateStore ¶
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 ¶
NewFileStore returns a store rooted at workspaceRoot (bootstrap files) with history persisted under stateDir.
func (*FileStore) DeleteHistory ¶
DeleteHistory deletes the persisted transcript for threadID.
func (*FileStore) DeleteWorkspaceHistory ¶ added in v0.0.2
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 ¶
LoadBootstrap reads the workspace bootstrap documents (in bootstrapFileOrder) that exist, each capped at maxBootstrap bytes.
func (*FileStore) LoadHistory ¶
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.