Documentation
¶
Overview ¶
Package threadindex persists lightweight chat-thread metadata shared by UI transports. Transcript content remains in the history store.
Index ¶
- func NewID(prefix string) (string, error)
- type Index
- type Session
- type Store
- type WorkspaceIndex
- func (x *WorkspaceIndex) Create() (Session, error)
- func (x *WorkspaceIndex) CreateWorkspaceThread(workspaceID string) (Session, error)
- func (x *WorkspaceIndex) Delete(id string) error
- func (x *WorkspaceIndex) DeleteWorkspaceThread(workspaceID, id string) error
- func (x *WorkspaceIndex) List() []Session
- func (x *WorkspaceIndex) ListWorkspace(workspaceID string) []Session
- func (x *WorkspaceIndex) RefreshWorkspace(_ context.Context, workspaceID string) error
- func (x *WorkspaceIndex) Rename(id, titleText string) error
- func (x *WorkspaceIndex) RenameWorkspaceThread(workspaceID, id, titleText string) error
- func (x *WorkspaceIndex) Touch(id, firstUserText string) error
- func (x *WorkspaceIndex) TouchWorkspaceThread(workspaceID, id, firstUserText string) error
- type WorkspaceLookup
- type WorkspaceStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Index ¶
type Index struct {
// contains filtered or unexported fields
}
Index is a JSON-file-backed registry of chat sessions.
type Session ¶
type Session struct {
ID string `json:"id"`
Title string `json:"title"`
Created int64 `json:"created"`
Updated int64 `json:"updated"`
}
Session is a chat thread's display metadata for switchers.
type Store ¶ added in v0.0.2
type Store interface {
List() []Session
Create() (Session, error)
Touch(id, firstUserText string) error
Rename(id, titleText string) error
Delete(id string) error
}
Store is the thread registry a UI needs: list the threads, make one, and keep its display metadata current. Index is the filesystem implementation; a backend that owns threads durably (e.g. MemoryLayer) implements the same surface so the UI can be pointed at either.
List returns a snapshot and is called from render paths, so an implementation must not block on a network round trip inside it.
type WorkspaceIndex ¶ added in v0.0.2
type WorkspaceIndex struct {
// contains filtered or unexported fields
}
WorkspaceIndex keeps one filesystem Index per logical workspace. The selected workspace retains the Store surface, while explicit workspace operations lazily open the isolated state directory for that workspace.
func NewWorkspaceIndex ¶ added in v0.0.2
func NewWorkspaceIndex(stateDir, defaultWorkspaceID string, now func() time.Time) (*WorkspaceIndex, error)
NewWorkspaceIndex creates a workspace-aware filesystem thread registry.
func (*WorkspaceIndex) Create ¶ added in v0.0.2
func (x *WorkspaceIndex) Create() (Session, error)
func (*WorkspaceIndex) CreateWorkspaceThread ¶ added in v0.0.2
func (x *WorkspaceIndex) CreateWorkspaceThread(workspaceID string) (Session, error)
func (*WorkspaceIndex) Delete ¶ added in v0.0.2
func (x *WorkspaceIndex) Delete(id string) error
func (*WorkspaceIndex) DeleteWorkspaceThread ¶ added in v0.0.2
func (x *WorkspaceIndex) DeleteWorkspaceThread(workspaceID, id string) error
func (*WorkspaceIndex) List ¶ added in v0.0.2
func (x *WorkspaceIndex) List() []Session
func (*WorkspaceIndex) ListWorkspace ¶ added in v0.0.2
func (x *WorkspaceIndex) ListWorkspace(workspaceID string) []Session
func (*WorkspaceIndex) RefreshWorkspace ¶ added in v0.0.2
func (x *WorkspaceIndex) RefreshWorkspace(_ context.Context, workspaceID string) error
RefreshWorkspace loads the workspace's durable index into this process.
func (*WorkspaceIndex) Rename ¶ added in v0.0.2
func (x *WorkspaceIndex) Rename(id, titleText string) error
func (*WorkspaceIndex) RenameWorkspaceThread ¶ added in v0.0.2
func (x *WorkspaceIndex) RenameWorkspaceThread(workspaceID, id, titleText string) error
func (*WorkspaceIndex) Touch ¶ added in v0.0.2
func (x *WorkspaceIndex) Touch(id, firstUserText string) error
func (*WorkspaceIndex) TouchWorkspaceThread ¶ added in v0.0.2
func (x *WorkspaceIndex) TouchWorkspaceThread(workspaceID, id, firstUserText string) error
type WorkspaceLookup ¶ added in v0.0.2
type WorkspaceLookup interface {
LookupWorkspaceThread(ctx context.Context, workspaceID, id string) (Session, bool, error)
}
WorkspaceLookup is the read-through thread metadata surface used by operational projections. Unlike WorkspaceStore.ListWorkspace, it may perform backend I/O and distinguishes a missing thread from a backend failure.
type WorkspaceStore ¶ added in v0.0.2
type WorkspaceStore interface {
Store
RefreshWorkspace(ctx context.Context, workspaceID string) error
ListWorkspace(workspaceID string) []Session
CreateWorkspaceThread(workspaceID string) (Session, error)
TouchWorkspaceThread(workspaceID, id, firstUserText string) error
RenameWorkspaceThread(workspaceID, id, titleText string) error
DeleteWorkspaceThread(workspaceID, id string) error
}
WorkspaceStore is the additive multi-workspace thread registry surface used by hosts that serve more than one logical project from a single backend. Legacy UI instances continue to use Store against their selected default.