agentapi

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FeedbackResponse

type FeedbackResponse struct {
	Type     string `json:"type"` // "feedback", "confirmed", "closed", "timeout"
	Feedback string `json:"feedback,omitempty"`
}

FeedbackResponse is returned from the poll-feedback endpoint.

type HTTPHandler

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

HTTPHandler handles agent-facing API requests.

func NewHTTPHandler

func NewHTTPHandler(taskStore *task.Store, epicStore *epic.Store, repoStore *repo.Store, githubToken *githubtoken.Service, workerRegistry *workertracker.Registry) *HTTPHandler

NewHTTPHandler creates a new HTTPHandler.

func (*HTTPHandler) EpicAppendLogs

func (h *HTTPHandler) EpicAppendLogs(c echo.Context) error

EpicAppendLogs handles POST /epics/:id/logs — agent appends session log entries.

func (*HTTPHandler) EpicHeartbeat

func (h *HTTPHandler) EpicHeartbeat(c echo.Context) error

EpicHeartbeat handles POST /epics/:id/heartbeat

func (*HTTPHandler) EpicPollFeedback

func (h *HTTPHandler) EpicPollFeedback(c echo.Context) error

EpicPollFeedback handles GET /epics/:id/poll-feedback — agent long-polls for user feedback.

func (*HTTPHandler) EpicPropose

func (h *HTTPHandler) EpicPropose(c echo.Context) error

EpicPropose handles POST /epics/:id/propose — agent submits proposed tasks.

func (*HTTPHandler) ListWorkers

func (h *HTTPHandler) ListWorkers(c echo.Context) error

ListWorkers handles GET /workers — returns actively polling workers.

func (*HTTPHandler) Poll

func (h *HTTPHandler) Poll(c echo.Context) error

Poll handles GET /poll — unified long-poll for available work. Tries to claim an epic first (higher priority), then a task.

func (*HTTPHandler) Register

func (h *HTTPHandler) Register(g *echo.Group)

Register adds the agent endpoints to the provided Echo router group.

func (*HTTPHandler) TaskAppendLogs

func (h *HTTPHandler) TaskAppendLogs(c echo.Context) error

TaskAppendLogs handles POST /tasks/:id/logs

func (*HTTPHandler) TaskComplete

func (h *HTTPHandler) TaskComplete(c echo.Context) error

TaskComplete handles POST /tasks/:id/complete

func (*HTTPHandler) TaskHeartbeat

func (h *HTTPHandler) TaskHeartbeat(c echo.Context) error

TaskHeartbeat handles POST /tasks/:id/heartbeat. Returns {"stopped": true} when the task is no longer in running status — either because it was explicitly stopped, closed, or deleted — so the worker cancels the agent container immediately and avoids wasting resources.

type PollResponse

type PollResponse struct {
	Type string `json:"type"` // "task" or "epic"

	// Task fields (present when Type == "task")
	Task *task.Task `json:"task,omitempty"`

	// Epic fields (present when Type == "epic")
	Epic *epic.Epic `json:"epic,omitempty"`

	// Common fields
	GitHubToken  string `json:"github_token,omitempty"`
	RepoFullName string `json:"repo_full_name"`
}

PollResponse is the discriminated union returned by the unified poll endpoint.

type ProposeTasksRequest

type ProposeTasksRequest struct {
	Tasks []epic.ProposedTask `json:"tasks"`
}

ProposeTasksRequest is the request body for agent proposing tasks.

type SessionLogRequest

type SessionLogRequest struct {
	Lines []string `json:"lines"`
}

SessionLogRequest is the request body for appending session log entries.

Jump to

Keyboard shortcuts

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