store

package
v0.2.21 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2026 License: MIT Imports: 20 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	FeedHealthOK      = "ok"
	FeedHealthError   = "error"
	FeedHealthBlocked = "blocked"
	FeedHealthDead    = "dead"
)

Variables

This section is empty.

Functions

func GenerateMCPBearerToken added in v0.2.5

func GenerateMCPBearerToken() (string, error)

func HashMCPBearerToken added in v0.2.5

func HashMCPBearerToken(token string) string

func NormalizeGitHubUsername added in v0.2.5

func NormalizeGitHubUsername(username string) string

NormalizeGitHubUsername returns the case-insensitive GitHub login key used for auth lookups.

Types

type ActivityStats

type ActivityStats struct {
	Now                       time.Time `json:"now"`
	Window                    string    `json:"window"`
	LatestItemUpdatedAt       time.Time `json:"latest_item_updated_at"`
	LatestSourceUpdatedAt     time.Time `json:"latest_source_updated_at"`
	LatestSourceSummaryAt     time.Time `json:"latest_source_summary_at"`
	ItemsUpdatedInWindow      int       `json:"items_updated_in_window"`
	SourcesUpdatedInWindow    int       `json:"sources_updated_in_window"`
	SourcesSummarizedInWindow int       `json:"sources_summarized_in_window"`
}

type AuthUser added in v0.2.5

type AuthUser struct {
	ID                       int64
	Provider                 string
	GitHubID                 string
	GitHubUsername           string
	GitHubUsernameNormalized string
	Email                    string
	Name                     string
	AvatarURL                string
	ApprovedAt               string
	LastLoginAt              string
	CreatedAt                string
	UpdatedAt                string
}

type BacklogStats

type BacklogStats struct {
	XHydrationPending             int           `json:"x_hydration_pending"`
	LinkDiscoveryPending          int           `json:"link_discovery_pending"`
	SourceExtractionPending       int           `json:"source_extraction_pending"`
	SourceSummaryPending          int           `json:"source_summary_pending"`
	SourceExtractionPendingByType []CountBucket `json:"source_extraction_pending_by_type"`
	SourceSummaryPendingByType    []CountBucket `json:"source_summary_pending_by_type"`
	Drained                       bool          `json:"drained"`
}

type CountBucket

type CountBucket struct {
	Key   string `json:"key"`
	Count int    `json:"count"`
}

type DeleteItemsResult

type DeleteItemsResult struct {
	Count     int      `json:"count"`
	NotePaths []string `json:"note_paths"`
	SourceIDs []int64  `json:"source_ids"`
}

type DeleteSourcesResult

type DeleteSourcesResult struct {
	Count     int      `json:"count"`
	NotePaths []string `json:"note_paths"`
}

type Feed added in v0.1.6

type Feed struct {
	ID                   int64
	FeedKey              string
	URL                  string
	NormalizedURL        string
	ResolvedURL          string
	SiteURL              string
	Title                string
	Description          string
	Language             string
	Enabled              bool
	HealthStatus         string
	PollIntervalSeconds  int
	NextFetchAfter       time.Time
	FetchETag            string
	FetchLastModified    string
	FetchBodyHash        string
	LastCheckedAt        time.Time
	LastFetchedAt        time.Time
	LastChangedAt        time.Time
	LastSuccessAt        time.Time
	FailureKind          string
	FirstFailedAt        time.Time
	LastFailedAt         time.Time
	LastHTTPStatus       int
	LastError            string
	ErrorCount           int
	LatestNormalizedJSON string
	UserTags             string
	CreatedAt            time.Time
	UpdatedAt            time.Time
}

type FeedEntry added in v0.1.6

type FeedEntry struct {
	FeedID          int64
	EntryKey        string
	IdentityKey     string
	GUID            string
	GUIDIsPermalink bool
	Link            string
	NormalizedLink  string
	Title           string
	Author          string
	PublishedAt     string
	EntryUpdatedAt  string
	SummaryHTML     string
	SummaryText     string
	ContentHTML     string
	ContentMarkdown string
	ContentText     string
	EnclosuresJSON  string
	ExtensionsJSON  string
	RawJSON         string
	ContentHash     string
	Item            model.Item
	SourceCandidate *model.SourceCandidate
	ObservedAt      time.Time
}

type FeedEntryApplyResult added in v0.1.6

type FeedEntryApplyResult struct {
	FeedEntryID      int64
	ItemID           int64
	SourceID         int64
	Created          bool
	Updated          bool
	Unchanged        bool
	Version          int
	SourceLinked     bool
	SourceCreated    bool
	IdentityConflict bool
}

type FeedFailureState added in v0.1.6

type FeedFailureState struct {
	FeedID         int64
	HealthStatus   string
	FailureKind    string
	LastHTTPStatus int
	Error          string
	FailedAt       time.Time
	NextFetchAfter time.Time
}

type FeedFetchRecord added in v0.1.6

type FeedFetchRecord struct {
	FeedID            int64
	ObservedAt        time.Time
	RequestURL        string
	FinalURL          string
	HTTPStatus        int
	HeadersJSON       string
	ContentEncoding   string
	DecodedBodyHash   string
	WireResponseBytes []byte
	DecodedSizeBytes  int64
	ParseStatus       string
	ParseError        string
}

type FeedFetchState added in v0.1.6

type FeedFetchState struct {
	FeedID               int64
	ResolvedURL          string
	Title                string
	SiteURL              string
	Description          string
	Language             string
	FetchETag            string
	FetchLastModified    string
	FetchBodyHash        string
	LatestNormalizedJSON string
	CheckedAt            time.Time
	FetchedAt            time.Time
	Changed              bool
	NextFetchAfter       time.Time
}

type FeedUpsert added in v0.1.6

type FeedUpsert struct {
	FeedKey             string
	URL                 string
	NormalizedURL       string
	ResolvedURL         string
	Title               string
	SiteURL             string
	Description         string
	Language            string
	PollIntervalSeconds int
	Enabled             bool
	UserTags            string
}

type FeedUpsertResult added in v0.1.6

type FeedUpsertResult struct {
	FeedID  int64
	Created bool
}

type GitHubAuthProfile added in v0.2.5

type GitHubAuthProfile struct {
	GitHubID       string
	GitHubUsername string
	Email          string
	Name           string
	AvatarURL      string
}

type MCPBearerToken added in v0.2.5

type MCPBearerToken struct {
	ID               int64  `json:"id"`
	Name             string `json:"name"`
	TokenFingerprint string `json:"token_fingerprint"`
	RevokedAt        string `json:"revoked_at,omitempty"`
	CreatedAt        string `json:"created_at"`
	UpdatedAt        string `json:"updated_at"`
}

type MCPBearerTokenCreateResult added in v0.2.5

type MCPBearerTokenCreateResult struct {
	Token  string         `json:"token"`
	Record MCPBearerToken `json:"record"`
}

type MigrationEvent

type MigrationEvent struct {
	Phase         MigrationPhase
	Version       int
	LatestVersion int
	Name          string
	Err           error
}

MigrationEvent describes one schema migration lifecycle event.

type MigrationPhase

type MigrationPhase string

MigrationPhase identifies the lifecycle state for a migration event.

const (
	// MigrationStarted is emitted before a missing migration starts running.
	MigrationStarted MigrationPhase = "started"
	// MigrationApplied is emitted after a missing migration has been applied and recorded.
	MigrationApplied MigrationPhase = "applied"
	// MigrationFailed is emitted when a missing migration or its metadata write fails.
	MigrationFailed MigrationPhase = "failed"
)

type MigrationReporter

type MigrationReporter func(MigrationEvent)

MigrationReporter receives migration lifecycle events during writable startup.

type OKFExportOptions added in v0.2.17

type OKFExportOptions struct {
	IncludeItems   bool
	IncludeSources bool
	SourceTypes    []string
	Limit          int
}

OKFExportOptions controls a read-only snapshot used by the OKF projection.

type OKFExportSnapshot added in v0.2.17

type OKFExportSnapshot struct {
	Items           []model.Item                     `json:"items"`
	Sources         []model.SourceDocument           `json:"sources"`
	ItemSources     map[int64][]model.ItemSourceRef  `json:"item_sources"`
	SourceBacklinks map[int64][]model.SourceBacklink `json:"source_backlinks"`
	ItemMedia       map[int64][]model.ItemMediaRef   `json:"item_media"`
	ItemChildren    map[int64][]model.SourceBacklink `json:"item_children"`
}

OKFExportSnapshot is a consistent SQLite view used by the OKF exporter.

type OpenOptions

type OpenOptions struct {
	MigrationReporter MigrationReporter
}

OpenOptions configures writable store startup behavior.

type PipelineStageRow

type PipelineStageRow struct {
	Kind           string  `json:"kind"`
	Total          int     `json:"total"`
	Current        int     `json:"current"`
	Pending        int     `json:"pending"`
	Blocked        int     `json:"blocked"`
	Failed         int     `json:"failed"`
	PercentCurrent float64 `json:"percent_current"`
}

type PipelineStats

type PipelineStats struct {
	SummaryPromptVersion string             `json:"summary_prompt_version"`
	SummaryTool          string             `json:"summary_tool"`
	SummaryToolVersion   string             `json:"summary_tool_version"`
	Hydration            []PipelineStageRow `json:"hydration"`
	Extraction           []PipelineStageRow `json:"extraction"`
	Summary              []PipelineStageRow `json:"summary"`
	Transcription        []PipelineStageRow `json:"transcription"`
	OCR                  []PipelineStageRow `json:"ocr"`
}

type PublicChatShare added in v0.2.6

type PublicChatShare struct {
	Slug             string
	OwnerProvider    string
	OwnerSubject     string
	OwnerUsername    string
	ContentHash      string
	Title            string
	Summary          string
	Categories       []string
	SanitizedContent string
	OriginalURLs     []string
	MetadataJSON     string
	CreatedAt        time.Time
	UpdatedAt        time.Time
}

type PublicChatShareInput added in v0.2.6

type PublicChatShareInput struct {
	OwnerProvider    string
	OwnerSubject     string
	OwnerUsername    string
	Title            string
	Summary          string
	Categories       []string
	SanitizedContent string
	OriginalURLs     []string
	MetadataJSON     string
}

type RebuildFTSStats

type RebuildFTSStats struct {
	Rebuilt int
	Skipped int
	Errors  int
}

type ResetSourceEnrichmentOptions

type ResetSourceEnrichmentOptions struct {
	Domains            []string
	SourceIDs          []int64
	SourceTypes        []string
	ExtractStatuses    []string
	SummaryStatuses    []string
	FailureKinds       []string
	MinFailures        int
	RehydrateXArticles bool
	DryRun             bool
}

type ResetSourceEnrichmentStats

type ResetSourceEnrichmentStats struct {
	Matched       int  `json:"matched"`
	Reset         int  `json:"reset"`
	XItemsMatched int  `json:"x_items_matched,omitempty"`
	XItemsReset   int  `json:"x_items_reset,omitempty"`
	DryRun        bool `json:"dry_run"`
}

type SourceActivityEvent

type SourceActivityEvent struct {
	SourceID     int64     `json:"source_id"`
	SourceKey    string    `json:"source_key"`
	SourceType   string    `json:"source_type"`
	Domain       string    `json:"domain"`
	FailureKind  string    `json:"failure_kind,omitempty"`
	CanonicalURL string    `json:"canonical_url"`
	Title        string    `json:"title"`
	NotePath     string    `json:"note_path"`
	EventKind    string    `json:"event_kind"`
	Status       string    `json:"status"`
	Message      string    `json:"message,omitempty"`
	EventAt      time.Time `json:"event_at"`
}

type SourceActivityFeed

type SourceActivityFeed struct {
	Window             string                     `json:"window"`
	RecentSuccesses    []SourceActivityEvent      `json:"recent_successes"`
	RecentFailures     []SourceActivityEvent      `json:"recent_failures"`
	FailureHotspots    []SourceFailureHotspot     `json:"failure_hotspots"`
	FailureKinds       []CountBucket              `json:"failure_kinds"`
	FailureStatuses    []CountBucket              `json:"failure_statuses"`
	FailureDomains     []CountBucket              `json:"failure_domains"`
	FailureTable       []SourceActivityEvent      `json:"failure_table"`
	FailureTableTotal  int                        `json:"failure_table_total"`
	FailureTableOffset int                        `json:"failure_table_offset"`
	FailureTableLimit  int                        `json:"failure_table_limit"`
	FailureTableSort   string                     `json:"failure_table_sort"`
	TrendBucket        string                     `json:"trend_bucket"`
	Trend              []SourceActivityTrendPoint `json:"trend"`
}

type SourceActivityFilter

type SourceActivityFilter struct {
	Limit         int
	FailureOffset int
	FailureSort   string
	SourceType    string
	Domain        string
	Status        string
	FailureKind   string
	Message       string
	Window        time.Duration
}

type SourceActivityTrendPoint

type SourceActivityTrendPoint struct {
	BucketStart  time.Time `json:"bucket_start"`
	Label        string    `json:"label"`
	SuccessCount int       `json:"success_count"`
	FailureCount int       `json:"failure_count"`
}

type SourceCountFilter

type SourceCountFilter struct {
	SourceType    string
	ExtractTool   string
	SummaryStatus string
	ExtractStatus string
}

type SourceFailureHotspot

type SourceFailureHotspot struct {
	Domain        string    `json:"domain"`
	SourceType    string    `json:"source_type"`
	Status        string    `json:"status"`
	FailureKind   string    `json:"failure_kind,omitempty"`
	Count         int       `json:"count"`
	LatestEventAt time.Time `json:"latest_event_at"`
}

type Store

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

func Open

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

func OpenReadOnly

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

OpenReadOnly opens an existing store for read-only consumers such as MCP. It intentionally skips schema creation/migrations so startup cannot block behind a long-running writer before the MCP initialize response is sent.

func OpenWithOptions

func OpenWithOptions(path string, opts OpenOptions) (*Store, error)

func (*Store) ActiveMCPBearerTokenCount added in v0.2.5

func (s *Store) ActiveMCPBearerTokenCount(ctx context.Context) (int, error)

func (*Store) Activity

func (s *Store) Activity(ctx context.Context, now time.Time, window time.Duration) (ActivityStats, error)

func (*Store) ApplyFeedEntry added in v0.1.6

func (s *Store) ApplyFeedEntry(ctx context.Context, entry FeedEntry) (FeedEntryApplyResult, error)

func (*Store) ApproveGitHubAuthUser added in v0.2.5

func (s *Store) ApproveGitHubAuthUser(ctx context.Context, username string) (AuthUser, bool, error)

func (*Store) Backlog

func (s *Store) Backlog(ctx context.Context, promptVersion string, toolName string, toolVersion string) (BacklogStats, error)

func (*Store) Close

func (s *Store) Close() error

func (*Store) CountExactUserTag

func (s *Store) CountExactUserTag(ctx context.Context, tag string, sourceTypes []string) (int, error)

func (*Store) CountItemTextMatches

func (s *Store) CountItemTextMatches(ctx context.Context, query string, sourceTypes []string) (int, error)

func (*Store) CountItems

func (s *Store) CountItems(ctx context.Context, sourceType string, groupBy string) ([]CountBucket, error)

func (*Store) CountSourceTextMatches

func (s *Store) CountSourceTextMatches(ctx context.Context, query string, sourceTypes []string) (int, error)

func (*Store) CountSources

func (s *Store) CountSources(ctx context.Context, filter SourceCountFilter, groupBy string) ([]CountBucket, error)

func (*Store) CreateMCPBearerToken added in v0.2.5

func (s *Store) CreateMCPBearerToken(ctx context.Context, name string) (MCPBearerTokenCreateResult, error)

func (*Store) DeleteItemsBySourceType

func (s *Store) DeleteItemsBySourceType(ctx context.Context, sourceType string) (DeleteItemsResult, error)

func (*Store) DeleteOrphanSources

func (s *Store) DeleteOrphanSources(ctx context.Context, sourceType string) (DeleteSourcesResult, error)

func (*Store) EnableFeed added in v0.1.6

func (s *Store) EnableFeed(ctx context.Context, ref string, enabled bool) error

func (*Store) GetFeed added in v0.1.6

func (s *Store) GetFeed(ctx context.Context, ref string) (Feed, error)

func (*Store) GetGitHubAuthUserByID added in v0.2.5

func (s *Store) GetGitHubAuthUserByID(ctx context.Context, githubID string) (AuthUser, bool, error)

func (*Store) GetGitHubAuthUserByUsername added in v0.2.5

func (s *Store) GetGitHubAuthUserByUsername(ctx context.Context, username string) (AuthUser, bool, error)

func (*Store) GetItem

func (s *Store) GetItem(ctx context.Context, lookup string) (model.Item, error)

func (*Store) GetItemByID

func (s *Store) GetItemByID(ctx context.Context, id int64) (model.Item, error)

func (*Store) GetItemEnrichment

func (s *Store) GetItemEnrichment(ctx context.Context, itemID int64, role string) (model.ItemEnrichment, error)

func (*Store) GetMCPBearerTokenByID added in v0.2.5

func (s *Store) GetMCPBearerTokenByID(ctx context.Context, id int64) (MCPBearerToken, bool, error)

func (*Store) GetMCPBearerTokenByRawToken added in v0.2.5

func (s *Store) GetMCPBearerTokenByRawToken(ctx context.Context, token string) (MCPBearerToken, bool, error)

func (*Store) GetMediaAsset

func (s *Store) GetMediaAsset(ctx context.Context, assetID int64) (model.MediaAsset, error)

func (*Store) GetPreferredLocalSourceExtract

func (s *Store) GetPreferredLocalSourceExtract(ctx context.Context, sourceID int64) (model.ExtractResult, bool, error)

func (*Store) GetPublicChatShareBySlug added in v0.2.6

func (s *Store) GetPublicChatShareBySlug(ctx context.Context, slug string) (PublicChatShare, bool, error)

func (*Store) GetSource

func (s *Store) GetSource(ctx context.Context, lookup string) (model.SourceDocument, error)

func (*Store) GetSourceByID

func (s *Store) GetSourceByID(ctx context.Context, sourceID int64) (model.SourceDocument, error)

func (*Store) GetSourceEvidence

func (s *Store) GetSourceEvidence(ctx context.Context, lookup string) (model.SourceDocument, error)

func (*Store) GetSourceExtractedText

func (s *Store) GetSourceExtractedText(ctx context.Context, lookup string) (string, error)

func (*Store) GetSourceExtractedTextPrefix added in v0.2.12

func (s *Store) GetSourceExtractedTextPrefix(ctx context.Context, lookup string, maxChars int) (string, error)

func (*Store) GetSourcesByIDs

func (s *Store) GetSourcesByIDs(ctx context.Context, sourceIDs []int64) ([]model.SourceDocument, error)

func (*Store) HasFTS

func (s *Store) HasFTS() bool

func (*Store) InvalidateItemOCR

func (s *Store) InvalidateItemOCR(ctx context.Context, itemID int64) error

func (*Store) InvalidateItemSummary

func (s *Store) InvalidateItemSummary(ctx context.Context, itemID int64) error

func (*Store) ListAllEntityItems

func (s *Store) ListAllEntityItems(ctx context.Context, limit int) ([]model.Item, error)

func (*Store) ListAllEntitySources

func (s *Store) ListAllEntitySources(ctx context.Context, limit int) ([]model.SourceDocument, error)

func (*Store) ListAllItems

func (s *Store) ListAllItems(ctx context.Context, limit int) ([]model.Item, error)

func (*Store) ListAllSources

func (s *Store) ListAllSources(ctx context.Context, limit int) ([]model.SourceDocument, error)

func (*Store) ListBacklinksForSource

func (s *Store) ListBacklinksForSource(ctx context.Context, sourceID int64) ([]model.SourceBacklink, error)

func (*Store) ListCategorizedItems

func (s *Store) ListCategorizedItems(ctx context.Context) ([]model.Item, error)

ListCategorizedItems returns all items that have a non-empty user_tags field.

func (*Store) ListCategorizedSources

func (s *Store) ListCategorizedSources(ctx context.Context) ([]model.SourceDocument, error)

ListCategorizedSources returns all sources that have a non-empty user_tags field.

func (*Store) ListCategorizedSourcesWithoutEvidence

func (s *Store) ListCategorizedSourcesWithoutEvidence(ctx context.Context) ([]model.SourceDocument, error)

ListCategorizedSourcesWithoutEvidence returns tagged sources that lack extracted or summarized evidence.

func (*Store) ListFeeds added in v0.1.6

func (s *Store) ListFeeds(ctx context.Context, includeDisabled bool) ([]Feed, error)

func (*Store) ListFeedsDue added in v0.1.6

func (s *Store) ListFeedsDue(ctx context.Context, now time.Time, limit int, includeBlocked bool) ([]Feed, error)

func (*Store) ListGitHubAuthUsers added in v0.2.5

func (s *Store) ListGitHubAuthUsers(ctx context.Context) ([]AuthUser, error)
func (s *Store) ListItemChildLinks(ctx context.Context, parentItemID int64, linkKind string) ([]int64, error)

func (*Store) ListItemMediaRefs

func (s *Store) ListItemMediaRefs(ctx context.Context, itemID int64) ([]model.ItemMediaRef, error)

func (*Store) ListItemMediaRefsForSourceKeys added in v0.2.10

func (s *Store) ListItemMediaRefsForSourceKeys(ctx context.Context, sourceKeys []string) (map[string][]model.ItemMediaRef, error)

func (*Store) ListItemSourceKeysByMediaLocalPath

func (s *Store) ListItemSourceKeysByMediaLocalPath(ctx context.Context, localPath string) ([]string, error)

func (*Store) ListItemsForCategorize

func (s *Store) ListItemsForCategorize(ctx context.Context, limit int, force bool) ([]model.Item, error)

ListItemsForCategorize returns items ordered newest-first. When force is false only items with an empty user_tags field are returned.

func (*Store) ListItemsForLinkDiscovery

func (s *Store) ListItemsForLinkDiscovery(ctx context.Context, limit int, force bool) ([]model.Item, error)

func (*Store) ListItemsForXHydration

func (s *Store) ListItemsForXHydration(ctx context.Context, limit int, force bool) ([]model.Item, error)

func (*Store) ListItemsForXMediaSummary

func (s *Store) ListItemsForXMediaSummary(ctx context.Context, limit int, force bool) ([]model.Item, error)

func (*Store) ListItemsForXMediaTranscription

func (s *Store) ListItemsForXMediaTranscription(ctx context.Context, limit int, force bool) ([]model.Item, error)

func (*Store) ListItemsForXPhotoOCR

func (s *Store) ListItemsForXPhotoOCR(ctx context.Context, limit int, force bool) ([]model.Item, error)

func (*Store) ListItemsForXPhotoOCRAudit

func (s *Store) ListItemsForXPhotoOCRAudit(ctx context.Context, limit int, includePruned bool) ([]model.Item, error)

func (*Store) ListItemsForXQuoteHydration

func (s *Store) ListItemsForXQuoteHydration(ctx context.Context, limit int, force bool) ([]model.Item, error)

func (*Store) ListLinkedItemsBySourceType added in v0.1.7

func (s *Store) ListLinkedItemsBySourceType(ctx context.Context, sourceID int64, sourceType string, limit int) ([]model.Item, error)

func (*Store) ListMCPBearerTokens added in v0.2.5

func (s *Store) ListMCPBearerTokens(ctx context.Context, includeRevoked bool) ([]MCPBearerToken, error)

func (*Store) ListMediaAssetsByLocalPath

func (s *Store) ListMediaAssetsByLocalPath(ctx context.Context, localPath string) ([]model.MediaAsset, error)

func (*Store) ListMediaAssetsForArchive

func (s *Store) ListMediaAssetsForArchive(ctx context.Context, limit int, force bool) ([]model.MediaAsset, error)

func (*Store) ListMediaAssetsForDownload

func (s *Store) ListMediaAssetsForDownload(ctx context.Context, limit int, force bool) ([]model.MediaAsset, error)

func (*Store) ListMediaAssetsForPrune

func (s *Store) ListMediaAssetsForPrune(ctx context.Context, limit int) ([]model.MediaAsset, error)

func (*Store) ListPublicChatSharesByOwner added in v0.2.6

func (s *Store) ListPublicChatSharesByOwner(ctx context.Context, ownerProvider string, ownerSubject string, limit int) ([]PublicChatShare, error)

func (*Store) ListSourcesForCategorize

func (s *Store) ListSourcesForCategorize(ctx context.Context, limit int, force bool) ([]model.SourceDocument, error)

ListSourcesForCategorize returns sources with extracted or summarized evidence ordered newest-first. When force is false only evidence-bearing sources with an empty user_tags field are returned.

func (*Store) ListSourcesForEnrichment

func (s *Store) ListSourcesForEnrichment(ctx context.Context, limit int, force bool, summarize bool, promptVersion string, toolName string, toolVersion string) ([]model.SourceDocument, error)

func (*Store) ListSourcesForItem

func (s *Store) ListSourcesForItem(ctx context.Context, itemID int64) ([]model.ItemSourceRef, error)

func (*Store) LoadOKFExportSnapshot added in v0.2.17

func (s *Store) LoadOKFExportSnapshot(ctx context.Context, opts OKFExportOptions) (OKFExportSnapshot, error)

func (*Store) MarkItemLinkDiscovery

func (s *Store) MarkItemLinkDiscovery(ctx context.Context, itemID int64, at time.Time) error

func (*Store) MarkMediaLocalPrunedByPath

func (s *Store) MarkMediaLocalPrunedByPath(ctx context.Context, localPath string, prunedAt time.Time) (int64, error)

func (*Store) Pipeline

func (s *Store) Pipeline(ctx context.Context, promptVersion string, toolName string, toolVersion string) (PipelineStats, error)

func (*Store) PurgeItemIndexedContent

func (s *Store) PurgeItemIndexedContent(ctx context.Context, sourceKey string, rawJSON string) (bool, error)

func (*Store) RebuildFTS

func (s *Store) RebuildFTS(ctx context.Context) (RebuildFTSStats, error)

func (*Store) RecordFeedFetch added in v0.1.6

func (s *Store) RecordFeedFetch(ctx context.Context, rec FeedFetchRecord) error

func (*Store) RemoveGitHubAuthUser added in v0.2.5

func (s *Store) RemoveGitHubAuthUser(ctx context.Context, username string) (AuthUser, bool, error)
func (s *Store) ReplaceItemChildLinks(ctx context.Context, parentItemID int64, linkKind string, childItemIDs []int64) (bool, error)

func (*Store) ResetSourceEnrichment

func (s *Store) ResetSourceEnrichment(ctx context.Context, opts ResetSourceEnrichmentOptions) (ResetSourceEnrichmentStats, error)

func (*Store) RevokeMCPBearerToken added in v0.2.5

func (s *Store) RevokeMCPBearerToken(ctx context.Context, ref string) (MCPBearerToken, bool, error)

func (*Store) SaveItemOCR

func (s *Store) SaveItemOCR(ctx context.Context, itemID int64, result model.OCRResult, inputHash string) (bool, error)

func (*Store) SaveItemSummary

func (s *Store) SaveItemSummary(ctx context.Context, itemID int64, summary model.SummaryResult, inputHash string) (bool, error)

func (*Store) SaveItemUserTags

func (s *Store) SaveItemUserTags(ctx context.Context, itemID int64, tags string) error

func (*Store) SaveMediaArchive

func (s *Store) SaveMediaArchive(ctx context.Context, assetID int64, result model.MediaArchiveResult) (bool, error)

func (*Store) SaveMediaDownload

func (s *Store) SaveMediaDownload(ctx context.Context, assetID int64, result model.MediaDownloadResult) (bool, error)

func (*Store) SavePublicChatShare added in v0.2.6

func (s *Store) SavePublicChatShare(ctx context.Context, input PublicChatShareInput) (PublicChatShare, error)

func (*Store) SaveSourceExtraction

func (s *Store) SaveSourceExtraction(ctx context.Context, sourceID int64, result model.ExtractResult, contentHash string) (bool, error)

func (*Store) SaveSourceSummary

func (s *Store) SaveSourceSummary(ctx context.Context, sourceID int64, result model.SummaryResult) (bool, error)

func (*Store) SaveSourceUserTags

func (s *Store) SaveSourceUserTags(ctx context.Context, sourceID int64, tags string) error

func (*Store) SaveXHydration

func (s *Store) SaveXHydration(ctx context.Context, itemID int64, hydration model.XHydration) (bool, error)

func (*Store) SaveXMediaTranscriptionState

func (s *Store) SaveXMediaTranscriptionState(ctx context.Context, itemID int64, status string, errorText string, at time.Time) error

func (*Store) Search

func (s *Store) Search(ctx context.Context, query string, limit int) ([]model.SearchResult, error)

func (*Store) SearchExactUserTag

func (s *Store) SearchExactUserTag(ctx context.Context, tag string, limit int) ([]model.SearchResult, error)

func (*Store) SearchSources

func (s *Store) SearchSources(ctx context.Context, query string, limit int) ([]model.SearchResult, error)

func (*Store) SearchUserTags

func (s *Store) SearchUserTags(ctx context.Context, tagQuery string, limit int) ([]model.SearchResult, error)

func (*Store) SourceActivityFeed

func (s *Store) SourceActivityFeed(ctx context.Context, limit int) (SourceActivityFeed, error)

func (*Store) SourceActivityFeedFiltered

func (s *Store) SourceActivityFeedFiltered(ctx context.Context, filter SourceActivityFilter) (SourceActivityFeed, error)

func (*Store) SourceHasLinkedItemType added in v0.1.7

func (s *Store) SourceHasLinkedItemType(ctx context.Context, sourceID int64, sourceType string) (bool, error)

func (*Store) UpdateFeedFailure added in v0.1.6

func (s *Store) UpdateFeedFailure(ctx context.Context, state FeedFailureState) error

func (*Store) UpdateFeedFetchState added in v0.1.6

func (s *Store) UpdateFeedFetchState(ctx context.Context, state FeedFetchState) error

func (*Store) UpdateGitHubAuthUserFromOAuth added in v0.2.5

func (s *Store) UpdateGitHubAuthUserFromOAuth(ctx context.Context, userID int64, profile GitHubAuthProfile) (AuthUser, error)

func (*Store) UpsertFeed added in v0.1.6

func (s *Store) UpsertFeed(ctx context.Context, input FeedUpsert) (FeedUpsertResult, error)

func (*Store) UpsertItem

func (s *Store) UpsertItem(ctx context.Context, item model.Item) (model.UpsertResult, error)

func (*Store) UpsertSource

func (s *Store) UpsertSource(ctx context.Context, candidate model.SourceCandidate) (model.SourceUpsertResult, error)
func (s *Store) UpsertSourceLink(ctx context.Context, itemID int64, candidate model.SourceCandidate) (model.SourceLinkUpsertResult, error)

func (*Store) ValidateMCPBearerToken added in v0.2.5

func (s *Store) ValidateMCPBearerToken(ctx context.Context, token string) (bool, error)

Source Files

Jump to

Keyboard shortcuts

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