api

package
v0.0.0-...-1ac8cb3 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: MIT Imports: 64 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 DefaultLiveReplyChecks = 30

DefaultLiveReplyChecks is each account's live reply checks per minute per replica: five open conversations at the browser's ten-second pace.

Variables

This section is empty.

Functions

func LiveReplyChecksFromEnv

func LiveReplyChecksFromEnv() (int, error)

LiveReplyChecksFromEnv reads DISCUSSION_LIVE_CHECKS_PER_MINUTE: each account's live reply checks per minute per replica, 0 (off) to 6000. Unset, empty or blank means DefaultLiveReplyChecks. The upper range is for benchmarks, whose simulated participants share a few accounts.

func NewAPI

func NewAPI(ctx context.Context, logger zerolog.Logger, cache kv.Store, options ...Option) (*api, error)

Types

type Option

type Option func(*api)

func WithAccounts

func WithAccounts(config accounts.Config, service *accounts.Service) Option

func WithAgentDrafts

func WithAgentDrafts(repository drafts.Repository) Option

WithAgentDrafts stores agents' private drafts for the person to review and publish at /me/drafts; it needs recommendations to publish reasons, and discussions to publish questions, tips and replies.

func WithDiscovery

func WithDiscovery(service *discovery.Service) Option

WithDiscovery shares one provider service between HTTP and scheduled reads. Apply it before options which construct services using discovery.

func WithDiscussionFollows

func WithDiscussionFollows(repository discussionfollows.Repository) Option

func WithEventActivity

func WithEventActivity(repository eventactivity.Repository) Option

func WithEventDiscussions

func WithEventDiscussions(repository discussions.Repository) Option

func WithEventInterests

func WithEventInterests(repository interests.Repository) Option

func WithEventRecommendations

func WithEventRecommendations(repository recommendations.Repository) Option

func WithFollows

func WithFollows(repository follows.Repository) Option

func WithLiveActivity

func WithLiveActivity(service *activity.Service, starts int) Option

func WithLiveReplyChecks

func WithLiveReplyChecks(perMinute int) Option

WithLiveReplyChecks sets each account's live reply checks per minute per replica; 0 turns live replies off, so conversations update on reload only.

func WithLocation

func WithLocation(resolver *location.Resolver) Option

WithLocation replaces the environment-configured IP location resolver.

func WithMCP

func WithMCP(config appmcp.Config) Option

WithMCP serves the agent tools at /mcp when config.Enabled: public tools, and signed-in tools for requests with a valid API token.

func WithMCPOAuth

func WithMCPOAuth(service *oauth.Service) Option

WithMCPOAuth lets agents sign in to /mcp through OAuth when MCP and config.OAuth are enabled and accounts are on.

func WithModeration

func WithModeration(repository moderation.Repository) Option

func WithPersistence

func WithPersistence(ready func(context.Context) error, durable *events.Service) Option

WithPersistence wires database readiness and durable identity services.

func WithRadar

func WithRadar(repository radar.Repository, freshFor time.Duration) Option

func WithReminders

func WithReminders(repository reminders.Repository) Option

func WithSavedEvents

func WithSavedEvents(repository saved.Repository) Option

func WithUserActivity

func WithUserActivity(repository useractivity.Repository) Option

Jump to

Keyboard shortcuts

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