api

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2026 License: MIT Imports: 35 Imported by: 0

Documentation

Overview

Package api will implement the looperd HTTP surface and adapters.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	Config             config.Config
	Runtime            RuntimeState
	WebhookForwarder   webhookforward.Forwarder
	ProjectsService    projectService
	Now                func() time.Time
	RecoverySummary    func() any
	ReconcileStaleRuns func(context.Context) (looperdruntime.StaleRunReconcileSummary, error)
	StopLoop           func(context.Context, string, string) (any, error)
	CloseLoop          func(context.Context, string, string) (any, error)
	StopAll            func(context.Context, string) (any, error)
	// TakeoverLoop parks a loop for interactive human takeover: stops the daemon's
	// in-flight run (session id preserved on disk) and transitions the loop to
	// human_takeover, returning what a human needs to resume the exact session.
	TakeoverLoop         func(context.Context, string, string) (TakeoverResult, error)
	RepairReviewer       func(context.Context, reviewer.RepairInput) (reviewer.RepairResult, error)
	TriggerSchedulerTick func()
}

type Handler

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

func NewHandler

func NewHandler(context Context) *Handler

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type RuntimeState

type RuntimeState interface {
	Services() looperdruntime.Services
	StartedAt() (time.Time, bool)
}

type Server

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

func NewServer

func NewServer(cfg config.Config, handler http.Handler) *Server

func (*Server) Addr

func (s *Server) Addr() net.Addr

func (*Server) Start

func (s *Server) Start() error

func (*Server) Stop

func (s *Server) Stop(ctx context.Context) error

type TakeoverResult added in v0.10.0

type TakeoverResult struct {
	LoopID       string
	Vendor       string
	SessionID    string
	WorktreePath string
}

TakeoverResult is what a takeover yields: the native session id + worktree + vendor of the loop's last run, so the caller can hand a human the exact resume command.

Jump to

Keyboard shortcuts

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