threadreadstate

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CodexSnapshot

type CodexSnapshot struct {
	UpdatedAtUnixS    int64
	ActivitySignature string
}

type FlowerSnapshot

type FlowerSnapshot struct {
	ActivityRevision    int64
	LastMessageAtUnixMs int64
	ActivitySignature   string
	WaitingPromptID     string
}

type Record

type Record struct {
	EndpointID                string  `json:"endpoint_id"`
	ScopeID                   string  `json:"scope_id"`
	Surface                   Surface `json:"surface"`
	ThreadID                  string  `json:"thread_id"`
	LastSeenActivityRevision  int64   `json:"last_seen_activity_revision"`
	LastReadMessageAtUnixMs   int64   `json:"last_read_message_at_unix_ms"`
	LastSeenWaitingPromptID   string  `json:"last_seen_waiting_prompt_id"`
	LastReadUpdatedAtUnixS    int64   `json:"last_read_updated_at_unix_s"`
	LastSeenActivitySignature string  `json:"last_seen_activity_signature"`
	UpdatedAtUnixMs           int64   `json:"updated_at_unix_ms"`
}

type Store

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

func Open

func Open(path string) (*Store, error)

func OpenResettingInvalidSchema added in v0.7.1

func OpenResettingInvalidSchema(path string) (*Store, error)

func (*Store) AdvanceCodex

func (s *Store) AdvanceCodex(
	ctx context.Context,
	endpointID string,
	userPublicID string,
	threadID string,
	snapshot CodexSnapshot,
) (Record, error)

func (*Store) AdvanceFlower

func (s *Store) AdvanceFlower(
	ctx context.Context,
	endpointID string,
	userPublicID string,
	threadID string,
	snapshot FlowerSnapshot,
) (Record, error)

func (*Store) Close

func (s *Store) Close() error

func (*Store) DeleteThread

func (s *Store) DeleteThread(
	ctx context.Context,
	endpointID string,
	surface Surface,
	threadID string,
) ([]Record, error)

func (*Store) EnsureCodex

func (s *Store) EnsureCodex(
	ctx context.Context,
	endpointID string,
	userPublicID string,
	snapshots map[string]CodexSnapshot,
) (map[string]Record, error)

func (*Store) EnsureFlower

func (s *Store) EnsureFlower(
	ctx context.Context,
	endpointID string,
	userPublicID string,
	snapshots map[string]FlowerSnapshot,
) (map[string]Record, error)

func (*Store) RestoreRecords

func (s *Store) RestoreRecords(ctx context.Context, records []Record) error

type Surface

type Surface string
const (
	SurfaceFlower Surface = "flower"
	SurfaceCodex  Surface = "codex"
)

Jump to

Keyboard shortcuts

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