httpapi

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Route

type Route struct {
	Pattern string
	Handler http.HandlerFunc
}

Route is one registered HTTP endpoint (Go 1.22 pattern with method prefix).

type Server

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

Server is the REST API server.

func NewServer

func NewServer(svc Service, wk Worker) *Server

NewServer builds the REST server.

func (*Server) Handler

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

Handler returns a self-contained mux (used by tests and standalone use). Production wires Routes into the gateway mux instead.

func (*Server) Routes

func (s *Server) Routes() []Route

Routes returns the memory endpoints for registration into an external mux (stage 5: gateway.Server). Health is provided by the gateway itself.

type Service

type Service interface {
	ProcessSession(ctx context.Context, agentID string, t store.Transcript) error
	SaveTranscript(ctx context.Context, t store.Transcript) error
	Recall(ctx context.Context, agentID, query string, opts recall.Options) (string, error)
	Search(ctx context.Context, agentID, query string, topK int) ([]recall.Result, error)
	GetByID(ctx context.Context, agentID, id string) (*recall.Result, error)
	ListLogs(ctx context.Context, agentID string, limit, offset int) ([]store.ChangeLog, error)
	ListInterestPoints(ctx context.Context, agentID string) ([]store.InterestPoint, error)
	ListPages(ctx context.Context, agentID string, pageType store.PageType) ([]store.Page, error)
	ListPendingLinks(ctx context.Context, agentID string) ([]store.PendingLink, error)
	Stats(ctx context.Context, agentID string) (map[string]int, error)
	Usage(ctx context.Context, since string) ([]store.UsageRow, error)
	ForkManual(ctx context.Context, agentID string) (*store.Transcript, error)
	KanbanBoardExcluded(boardID, boardName string) bool
	ListGraph(ctx context.Context, agentID string) (*service.Graph, error)
}

Service is the orchestration surface the HTTP layer calls (implemented by *service.Service).

type Worker

type Worker interface {
	Enqueue(ctx context.Context, agentID, sessionID string) (string, error)
	GetJob(ctx context.Context, jobID string) (*worker.Job, error)
}

Worker is the async queue surface (implemented by *worker.Worker).

Jump to

Keyboard shortcuts

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