reading

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const MaxSearchResults = 20

Variables

View Source
var ErrPinLimit = errors.New("you can pin at most 6 reading items")

Functions

func MarkAllRead added in v0.0.7

func MarkAllRead(ctx context.Context, app core.App, actorID string) (int, error)

MarkAllRead marks every active unread reading item owned by the actor as read.

func Register

func Register(app core.App)

func SetPinned

func SetPinned(ctx context.Context, app core.App, actorID, itemID string, pinned bool) error

Types

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 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.

func Create

func Create(ctx context.Context, app core.App, actorID string, input CreateInput) (Item, error)

Create creates a new reading item owned by the actor.

func Get

func Get(ctx context.Context, app core.App, actorID, itemID string, includeContent bool) (Item, error)

Get returns a single reading item by ID. When includeContent is true the full content_text is included; otherwise it is omitted to keep the payload small.

func Update

func Update(ctx context.Context, app core.App, actorID, itemID string, input UpdateInput) (Item, error)

Update applies non-nil fields of input to the reading item owned by the actor and returns the updated item.

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(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

type SearchOptions struct {
	Query     string
	Status    string
	ProjectID string
	Limit     int
}

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

func Summarize(ctx context.Context, app core.App, actorID, itemID string) (SummarizeResult, error)

Summarize fetches the article content from the item's URL, generates a summary using the actor's default model, and persists the results.

type UpdateInput

type UpdateInput struct {
	Title           *string
	Description     *string
	Tags            *[]string
	Status          *string
	ProjectID       *string
	SummaryLanguage *string
}

UpdateInput holds the optional fields for updating a reading item. Only non-nil fields are applied.

Jump to

Keyboard shortcuts

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