api

package
v2.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: MIT Imports: 54 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

Overview

Package api is lectern's HTTP surface: the REST control plane, the agent-facing hook endpoints, the SSE streams and the embedded PWA.

Index

Constants

View Source
const (
	AgentTaskCap = 10
	NoteCap      = 20
)

AgentTaskCap and NoteCap bound what one attempt can file, so a looping agent cannot flood the board or the memory store.

Variables

View Source
var ClaudeModels = []string{"fable", "opus", "sonnet", "haiku"}

ClaudeModels are the shorthands Claude Code accepts. Every other agent names its models differently and the set moves, so there is nothing honest to hardcode for them — what you have actually used is the better suggestion.

Functions

This section is empty.

Types

type Server

type Server struct {
	DB        *store.DB
	Bus       *bus.Bus
	Broker    *broker.Broker
	Notifier  *sinks.Notifier
	Reg       *executor.Registry
	Sched     *scheduler.Scheduler
	Sessions  *sessions.Manager
	Memory    memory.Provider
	Terminals *terminal.Manager
	Push      *push.Sender
	Cfg       *config.Config
	Log       *slog.Logger
	// contains filtered or unexported fields
}

Server wires every dependency the handlers need.

func (*Server) Creds

func (s *Server) Creds() *creds.Provisioner

Creds exposes the provisioner the scheduler owns, so the deep probe and a dispatch can never drift apart.

func (*Server) DrainStreams

func (s *Server) DrainStreams()

DrainStreams ends open-ended live updates before HTTP graceful shutdown waits for requests. Ordinary requests retain their own lifetime and drain normally.

func (*Server) Handler

func (s *Server) Handler() http.Handler

Handler builds the full router, including auth and the embedded web app.

func (*Server) RunDueRoutines

func (s *Server) RunDueRoutines(ctx context.Context)

RunDueRoutines fires every scheduled routine whose time has come. The scheduler calls this on its tick.

A routine that cannot be scheduled any more (its schedule was edited to something unreadable) is disabled rather than retried forever, and says so in the log — a job silently firing every two seconds is a much worse failure than one that stops.

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context)

Shutdown releases everything the server owns.

Jump to

Keyboard shortcuts

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