Documentation
¶
Index ¶
- Constants
- Variables
- func MarkAllRead(ctx context.Context, app core.App, actorID string) (int, error)
- func Register(app core.App)
- func SeedPresets(app core.App, ownerID string) error
- func SetPinned(ctx context.Context, app core.App, actorID, itemID string, pinned bool) error
- type Candidate
- type CreateInput
- type DiscoverFailure
- type DiscoverResult
- type Item
- func Create(ctx context.Context, app core.App, actorID string, input CreateInput) (Item, error)
- func Get(ctx context.Context, app core.App, actorID, itemID string, includeContent bool) (Item, error)
- func Update(ctx context.Context, app core.App, actorID, itemID string, input UpdateInput) (Item, error)
- type ItemSummary
- type SearchOptions
- type Source
- type SummarizeResult
- type UpdateInput
Constants ¶
const ( KindRSS = "rss" KindGitHubTrending = "github_trending" )
The kinds a subscription can have. Every third-party feed the user pastes in is an RSS or Atom document, including the release feed of a repository they follow; GitHub trending is the one source with no feed to subscribe to.
const MaxSearchResults = 20
Variables ¶
var ErrPinLimit = errors.New("you can pin at most 6 reading items")
Functions ¶
func MarkAllRead ¶ added in v0.0.7
MarkAllRead marks every active unread reading item owned by the actor as read.
func SeedPresets ¶ added in v0.1.1
SeedPresets gives an account the preset feeds. Presets are a convenience, so a caller that fails here should log rather than fail the account.
Types ¶
type Candidate ¶ added in v0.1.1
type Candidate struct {
SourceID string `json:"sourceId"`
SourceName string `json:"sourceName"`
Title string `json:"title"`
URL string `json:"url"`
Description string `json:"description,omitempty"`
PublishedAt string `json:"publishedAt,omitempty"`
Language string `json:"language,omitempty"`
Stars int `json:"stars,omitempty"`
PeriodStars int `json:"periodStars,omitempty"`
StarsPeriod string `json:"starsPeriod,omitempty"`
AlreadySaved bool `json:"alreadySaved"`
}
Candidate is one entry a subscription offered. Candidates are never stored: the panel holds them until the user keeps one, which then becomes an ordinary reading item.
type CreateInput ¶
type CreateInput struct {
URL string
Title string
Description string
Tags []string
Status string
ProjectID string
SummaryLanguage string
}
CreateInput holds the fields for creating a reading item.
type DiscoverFailure ¶ added in v0.1.1
type DiscoverFailure struct {
SourceID string `json:"sourceId"`
SourceName string `json:"sourceName"`
Message string `json:"message"`
}
DiscoverFailure reports one subscription that could not be read. A failure is returned alongside the candidates rather than instead of them, so one broken feed does not empty the panel.
type DiscoverResult ¶ added in v0.1.1
type DiscoverResult struct {
Items []Candidate `json:"items"`
Failures []DiscoverFailure `json:"failures"`
}
type Item ¶
type Item struct {
ID string `json:"id"`
Title string `json:"title"`
URL string `json:"url"`
Description string `json:"description,omitempty"`
ProjectID string `json:"projectId,omitempty"`
Status string `json:"status"`
Tags []string `json:"tags,omitempty"`
Summary string `json:"summary,omitempty"`
KeyPoints []string `json:"keyPoints,omitempty"`
ContentText string `json:"contentText,omitempty"`
SummaryLanguage string `json:"summaryLanguage,omitempty"`
}
Item is the full reading item projection returned by Create and Get.
type ItemSummary ¶
type ItemSummary struct {
ID string `json:"id"`
Title string `json:"title"`
URL string `json:"url"`
Description string `json:"description,omitempty"`
ProjectID string `json:"projectId,omitempty"`
Status string `json:"status"`
Summary string `json:"summary,omitempty"`
KeyPoints []string `json:"keyPoints,omitempty"`
Tags []string `json:"tags,omitempty"`
SummaryLanguage string `json:"summaryLanguage,omitempty"`
}
ItemSummary is the lightweight projection returned by Search. It excludes content_text to avoid large payloads in tool results.
func Search ¶
func Search(ctx context.Context, app core.App, actorID string, options SearchOptions) ([]ItemSummary, error)
Search returns the reading items owned by an authenticated user, optionally filtered by a fuzzy query and status. Agent tools call this domain query instead of duplicating collection authorization logic.
type SearchOptions ¶
SearchOptions controls the reading item query.
type SummarizeResult ¶
type SummarizeResult struct {
ContentText string `json:"contentText"`
Summary string `json:"summary"`
KeyPoints []string `json:"keyPoints"`
}
SummarizeResult is the outcome of fetching and summarizing an article.
func Summarize ¶
Summarize fetches the article content from the item's URL, generates a summary using the actor's default model, and persists the results.
func SummarizeURL ¶ added in v0.1.1
func SummarizeURL(ctx context.Context, app core.App, actorID, rawURL, title, language string) (SummarizeResult, error)
SummarizeURL fetches a page and summarizes it without storing anything, so a candidate can be read in the chosen language before it is kept.